comparison libpurple/protocols/yahoo/yahoo.c @ 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 48df71b5cfd1
comparison
equal deleted inserted replaced
27168:463ed40d4031 27169:fa2fb12b0fcc
72 char *status = NULL; 72 char *status = NULL;
73 73
74 if (!gc || !name || !f || !purple_find_buddy(purple_connection_get_account(gc), name)) 74 if (!gc || !name || !f || !purple_find_buddy(purple_connection_get_account(gc), name))
75 return; 75 return;
76 76
77 if (f->status == YAHOO_STATUS_OFFLINE)
78 {
79 return;
80 }
81
82 switch (f->status) { 77 switch (f->status) {
78 case YAHOO_STATUS_OFFLINE:
79 status = YAHOO_STATUS_TYPE_OFFLINE;
80 break;
83 case YAHOO_STATUS_AVAILABLE: 81 case YAHOO_STATUS_AVAILABLE:
84 status = YAHOO_STATUS_TYPE_AVAILABLE; 82 status = YAHOO_STATUS_TYPE_AVAILABLE;
85 break; 83 break;
86 case YAHOO_STATUS_BRB: 84 case YAHOO_STATUS_BRB:
87 status = YAHOO_STATUS_TYPE_BRB; 85 status = YAHOO_STATUS_TYPE_BRB;
359 } 357 }
360 358
361 l = l->next; 359 l = l->next;
362 } 360 }
363 361
364 if (message && f) 362 if (f) {
365 yahoo_friend_set_status_message(f, yahoo_string_decode(gc, message, unicode)); 363 if (pkt->service == YAHOO_SERVICE_LOGOFF)
366 364 f->status = YAHOO_STATUS_OFFLINE;
367 if (name && f) /* update the last buddy */ 365 if (message)
368 yahoo_update_status(gc, name, f); 366 yahoo_friend_set_status_message(f, yahoo_string_decode(gc, message, unicode));
367
368 if (name) /* update the last buddy */
369 yahoo_update_status(gc, name, f);
370 }
369 g_free(msn_name); 371 g_free(msn_name);
370 } 372 }
371 373
372 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group) 374 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group)
373 { 375 {