changeset 24699:508e57943440

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>
author Laurent Montaron <lpm+pidgin.im@pobox.com>
date Mon, 15 Dec 2008 04:20:28 +0000
parents d1da5c4c1e6b
children 041bb386bf96
files COPYRIGHT ChangeLog libpurple/protocols/sametime/sametime.c
diffstat 3 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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