# HG changeset patch # User Laurent Montaron # Date 1229314828 0 # Node ID 508e579434409c51a74615aaefe125b2eb911c39 # Parent d1da5c4c1e6bde825585f4bb33b8cecc88da9ac8 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 diff -r d1da5c4c1e6b -r 508e57943440 COPYRIGHT --- 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 diff -r d1da5c4c1e6b -r 508e57943440 ChangeLog --- 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) diff -r d1da5c4c1e6b -r 508e57943440 libpurple/protocols/sametime/sametime.c --- 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