*** Plucked rev 066619e375f28c7d7fe42655607c72fe107f6ebf (sadrul@pidgin.im): release-2.5.8

Thu, 25 Jun 2009 23:30:58 +0000

author
John Bailey <rekkanoryo@rekkanoryo.org>
date
Thu, 25 Jun 2009 23:30:58 +0000
branch
release-2.5.8
changeset 25775
90f13edd721a
parent 25774
550e6ec7c9fd
child 25776
664ded49d52f

*** Plucked rev 066619e375f28c7d7fe42655607c72fe107f6ebf (sadrul@pidgin.im):
Detect properly when yahoo buddies go offline.

libpurple/protocols/yahoo/yahoo.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/yahoo/yahoo.c	Sat Jun 20 22:25:10 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Thu Jun 25 23:30:58 2009 +0000
@@ -72,12 +72,10 @@
 	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;
@@ -335,11 +333,15 @@
 		l = l->next;
 	}
 
-	if (message && f)
-		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 (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) /* update the last buddy */
+			yahoo_update_status(gc, name, f);
+	}
 }
 
 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group)

mercurial