libpurple/protocols/yahoo/yahoo.c

branch
release-2.5.8
changeset 25775
90f13edd721a
parent 25769
0898bf338128
child 25778
1c726d419ae6
--- 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