# HG changeset patch # User Sadrul Habib Chowdhury # Date 1245835592 0 # Node ID fa2fb12b0fcc223f5fe894c5d1e7a0bc7d029841 # Parent 463ed40d4031cdefff2814914907467288225bb3 Detect properly when yahoo buddies go offline. diff -r 463ed40d4031 -r fa2fb12b0fcc libpurple/protocols/yahoo/yahoo.c --- 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); }