changeset 27169:fa2fb12b0fcc

Detect properly when yahoo buddies go offline.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 24 Jun 2009 09:26:32 +0000
parents 463ed40d4031
children f2baa434a977
files libpurple/protocols/yahoo/yahoo.c
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Wed Jun 24 08:17:33 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Wed Jun 24 09:26:32 2009 +0000
@@ -74,12 +74,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;
@@ -361,11 +359,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);
+	}
 	g_free(msn_name);
 }