Fix ludicrously long idle times for Sametime 7.5 buddies by assuming idle time

Mon, 15 Dec 2008 04:20:28 +0000

author
Laurent Montaron <lpm+pidgin.im@pobox.com>
date
Mon, 15 Dec 2008 04:20:28 +0000
changeset 25181
a104228b1fce
parent 25180
3aecff7754d5
child 25187
615f3c4e4da6

Fix ludicrously long idle times for Sametime 7.5 buddies by assuming idle time
is 0 if the idle timestamp from the buddy is in the future. Fixes #3437.


committer: John Bailey <rekkanoryo@rekkanoryo.org>

COPYRIGHT file | annotate | diff | comparison | revisions
ChangeLog file | annotate | diff | comparison | revisions
libpurple/protocols/sametime/sametime.c file | annotate | diff | comparison | revisions
--- a/COPYRIGHT	Mon Dec 15 04:02:28 2008 +0000
+++ b/COPYRIGHT	Mon Dec 15 04:20:28 2008 +0000
@@ -272,6 +272,7 @@
 David Mohr
 Andrew Molloy
 Michael Monreal
+Laurent Montaron
 Marco Monteiro
 Benjamin Moody
 John Moody
--- a/ChangeLog	Mon Dec 15 04:02:28 2008 +0000
+++ b/ChangeLog	Mon Dec 15 04:20:28 2008 +0000
@@ -22,6 +22,8 @@
 	* Many QQ fixes and improvements, including the ability to connect
 	  using QQ2008 protocol and sending/receiving of long messages.
 	* Fix a crash with DNS SRV lookups (Florian Quèze)
+	* Fix insanely long idle times for Sametime 7.5 buddies by assuming 0 idle
+	  time if the idle timestamp is in the future (Laurent Montaron)
 
 	Gadu-Gadu:
 	* Fix some problems with Gadu-Gadu buddy icons (Adam Strzelecki)
--- a/libpurple/protocols/sametime/sametime.c	Mon Dec 15 04:02:28 2008 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Mon Dec 15 04:20:28 2008 +0000
@@ -514,6 +514,11 @@
     idle_len = time(NULL) - idle;
     ugly_idle_len = ((time(NULL) * 1000) - idle) / 1000;
 
+	if(idle > ugly_idle_len)
+		ugly_idle_len = 0;
+	else
+		ugly_idle_len = (ugly_idle_len - idle) / 1000;
+
     /* 
        what's the deal here? Well, good clients are smart enough to
        publish their idle time by using an attribute to indicate that

mercurial