# HG changeset patch # User Sulabh Mahajan # Date 1252424663 0 # Node ID 860998956a4dcdd686775aebae9d4248e563e45c # Parent c51f00627af49d8f5cc3bdf88165f9ccb305421b Better, accurate handling of idle time for a yahoo buddy. Fixes #10099 diff -r c51f00627af4 -r 860998956a4d libpurple/protocols/yahoo/libymsg.c --- a/libpurple/protocols/yahoo/libymsg.c Mon Sep 07 18:28:28 2009 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Tue Sep 08 15:44:23 2009 +0000 @@ -220,7 +220,12 @@ if (f->status == YAHOO_STATUS_IDLE) { /* Idle may have already been set in a more precise way in case 137 */ if (f->idle == 0) - f->idle = time(NULL); + { + if(pkt->service == YAHOO_SERVICE_STATUS_15) + f->idle = -1; + else + f->idle = time(NULL); + } } else f->idle = 0; @@ -253,15 +258,20 @@ if (f->away == 2) { /* Idle may have already been set in a more precise way in case 137 */ if (f->idle == 0) - f->idle = time(NULL); + { + if(pkt->service == YAHOO_SERVICE_STATUS_15) + f->idle = -1; + else + f->idle = time(NULL); + } } break; - case 138: /* either we're not idle, or we are but won't say how long */ + case 138: /* when value is 1, either we're not idle, or we are but won't say how long */ if (!f) break; - if (f->idle) + if( (strtol(pair->value, NULL, 10) == 1) && (f->idle) ) f->idle = -1; break; case 137: /* usually idle time in seconds, sometimes login time */