[I was sent this by Tim van Erven - thanks - so I'd appreciate CCs of
any replies since I'm not on the devel list.]

Daniel Gl�ckner <[EMAIL PROTECTED]> wrote on Sat, 31 Aug 2002 23:34:34 +0200:

>Licq always sets the timezone offset to the non DST offset but
>calculates the unix time of incoming packets with the current offset.
>The attached patch should fix it.
>
>diff -ruwd licq-20020831/src/icqd-srv.cpp licq-20020831-my/src/icqd-srv.cpp
>--- licq-20020831/src/icqd-srv.cpp     Fri Aug 23 07:45:05 2002
>+++ licq-20020831-my/src/icqd-srv.cpp  Sat Aug 31 23:18:41 2002
>@@ -2412,7 +2412,7 @@
>       sendTM.tm_hour = msg.UnpackChar();
>       sendTM.tm_min = msg.UnpackChar();
>       sendTM.tm_sec = 0;
>-      sendTM.tm_isdst = -1;
>+      sendTM.tm_isdst = 0;
>       nTimeSent = mktime(&sendTM);
>       
>       // Msg type & flags

I'm sure this fixes something, but it doesn't seem to affect what time
it says at the top of the [send] "Message" window (qt-gui plugin).

However...

I've noticed that my own "general info" window under Licq gives a
timezone of "GMT-100".  I believe this boils down to a sign error
in user.cpp.  I was sure this *used* to be right - in fact I've just
downloaded the source of licq-0.85 and the code is correct in there,
so who changed it?!

I'm using Solaris which doesn't have the tm_gmtoff element of the tm
structure.  I think Linux does tend to have that element, but the code
there is wrong too because tm_gmtoff should already include the DST
offset if applicable.

Here is the correct code from licq-0.85:

#ifdef USE_GMTOFF
  return -(tzone->tm_gmtoff); // seconds _east_ of UTC
#elif defined(USE_TIMEZONE)
  return timezone - (tzone->tm_isdst == 1 ? 3600 : 0); // seconds _west_ of UTC

Here is the incorrect code from licq-1.2.0a:

#ifdef USE_GMTOFF
  return -(tzone->tm_gmtoff) + (tzone->tm_isdst == 1 ? 3600 : 0); // seconds _east_ of 
UTC
#elif defined(USE_TIMEZONE)
  return timezone + (tzone->tm_isdst == 1 ? 3600 : 0); // seconds _west_ of UTC

Now...

With this corrected, Licq *still* doesn't have the user's actual
local time in the Send window.  However, the time in the Send window
does now agree with the Timezone listed in the user's general info.
So the question is why Licq thinks the user is in GMT+000 when they
are actually in the zone GMT+100 (daylight savings time).  I guess
this is because

>Licq always sets the timezone offset to the non DST offset

but why, and is there another patch similar to the above which affects
the GUI side of things, or does the other user just have the wrong
timezone set in ICQ?

imc


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Licq-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/licq-devel

Reply via email to