pidgin: 066619e3: Detect properly when yahoo buddies go of...

sadrul at pidgin.im sadrul at pidgin.im
Wed Jun 24 05:30:35 EDT 2009


-----------------------------------------------------------------
Revision: 066619e375f28c7d7fe42655607c72fe107f6ebf
Ancestor: 550161a2fd8cd2aa8530ef2b12fe864a90e9509f
Author: sadrul at pidgin.im
Date: 2009-06-24T09:26:32
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/066619e375f28c7d7fe42655607c72fe107f6ebf

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

ChangeLog: 

Detect properly when yahoo buddies go offline.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	ed45aff1e2d8a45f578f5064049366380a923bf8
+++ libpurple/protocols/yahoo/yahoo.c	11185f50aa12b2ed97585f6d7769d14f0d13887e
@@ -74,12 +74,10 @@ static void yahoo_update_status(PurpleCo
 	if (!gc || !name || !f || !purple_find_buddy(purple_connection_get_account(gc), name))
 		return;
 
-	if (f->status == YAHOO_STATUS_OFFLINE)
-	{
-		return;
-	}
-
 	switch (f->status) {
+	case YAHOO_STATUS_OFFLINE:
+		status = YAHOO_STATUS_TYPE_OFFLINE;
+		break;
 	case YAHOO_STATUS_AVAILABLE:
 		status = YAHOO_STATUS_TYPE_AVAILABLE;
 		break;
@@ -361,11 +359,15 @@ static void yahoo_process_status(PurpleC
 		l = l->next;
 	}
 
-	if (message && f)
-		yahoo_friend_set_status_message(f, yahoo_string_decode(gc, message, unicode));
+	if (f) {
+		if (pkt->service == YAHOO_SERVICE_LOGOFF)
+			f->status = YAHOO_STATUS_OFFLINE;
+		if (message)
+			yahoo_friend_set_status_message(f, yahoo_string_decode(gc, message, unicode));
 
-	if (name && f) /* update the last buddy */
-		yahoo_update_status(gc, name, f);
+		if (name) /* update the last buddy */
+			yahoo_update_status(gc, name, f);
+	}
 	g_free(msn_name);
 }
 


More information about the Commits mailing list