pidgin: 40005b88: Better, accurate handling of idle time f...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Tue Sep 8 11:50:47 EDT 2009


-----------------------------------------------------------------
Revision: 40005b889ee276fbcd0a4e886a68d8a8cce45698
Ancestor: 37aa00d044431100d37466517568640cb082680c
Author: sulabh at soc.pidgin.im
Date: 2009-09-08T15:44:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/40005b889ee276fbcd0a4e886a68d8a8cce45698

Modified files:
        libpurple/protocols/yahoo/libymsg.c

ChangeLog: 

Better, accurate handling of idle time for a yahoo buddy. Fixes #10099

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	87ad7ef7612ac888772e8afa7bcb20743f1b3d9c
+++ libpurple/protocols/yahoo/libymsg.c	9f4d92c3fc86e7a91514246a63ebbd3b9c5c6f05
@@ -220,7 +220,12 @@ static void yahoo_process_status(PurpleC
 			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 @@ static void yahoo_process_status(PurpleC
 			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 */


More information about the Commits mailing list