| 598 g_free(html); |
598 g_free(html); |
| 599 } |
599 } |
| 600 } |
600 } |
| 601 |
601 |
| 602 static void |
602 static void |
| 603 fb_cb_api_presences(FbApi *api, GSList *press, gpointer data) |
603 fb_cb_api_presences(FbApi *api, GSList *presences, gpointer data) |
| 604 { |
604 { |
| 605 const gchar *statid; |
605 const gchar *statid; |
| 606 FbApiPresence *pres; |
|
| 607 FbData *fata = data; |
606 FbData *fata = data; |
| 608 gchar uid[FB_ID_STRMAX]; |
607 gchar uid[FB_ID_STRMAX]; |
| 609 GSList *l; |
608 GSList *l; |
| 610 PurpleAccount *acct; |
609 PurpleAccount *acct; |
| 611 PurpleConnection *gc; |
610 PurpleConnection *gc; |
| 612 PurpleStatusPrimitive pstat; |
611 PurpleStatusPrimitive pstat; |
| 613 |
612 |
| 614 gc = fb_data_get_connection(fata); |
613 gc = fb_data_get_connection(fata); |
| 615 acct = purple_connection_get_account(gc); |
614 acct = purple_connection_get_account(gc); |
| 616 |
615 |
| 617 for (l = press; l != NULL; l = l->next) { |
616 for (l = presences; l != NULL; l = l->next) { |
| 618 pres = l->data; |
617 FbApiPresence *api_presence = l->data; |
| 619 |
618 |
| 620 if (pres->active) { |
619 if (api_presence->active) { |
| 621 pstat = PURPLE_STATUS_AVAILABLE; |
620 pstat = PURPLE_STATUS_AVAILABLE; |
| 622 } else { |
621 } else { |
| 623 pstat = PURPLE_STATUS_OFFLINE; |
622 pstat = PURPLE_STATUS_OFFLINE; |
| 624 } |
623 } |
| 625 |
624 |
| 626 FB_ID_TO_STR(pres->uid, uid); |
625 FB_ID_TO_STR(api_presence->uid, uid); |
| 627 statid = purple_primitive_get_id_from_type(pstat); |
626 statid = purple_primitive_get_id_from_type(pstat); |
| 628 purple_protocol_got_user_status(acct, uid, statid, NULL); |
627 purple_protocol_got_user_status(acct, uid, statid, NULL); |
| 629 } |
628 } |
| 630 } |
629 } |
| 631 |
630 |
| 1172 static void |
1171 static void |
| 1173 fb_client_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *buddy, |
1172 fb_client_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *buddy, |
| 1174 PurpleNotifyUserInfo *info, gboolean full) |
1173 PurpleNotifyUserInfo *info, gboolean full) |
| 1175 { |
1174 { |
| 1176 const gchar *name; |
1175 const gchar *name; |
| 1177 PurplePresence *pres; |
1176 PurplePresence *presence; |
| 1178 PurpleStatus *status; |
1177 PurpleStatus *status; |
| 1179 |
1178 |
| 1180 pres = purple_buddy_get_presence(buddy); |
1179 presence = purple_buddy_get_presence(buddy); |
| 1181 status = purple_presence_get_active_status(pres); |
1180 status = purple_presence_get_active_status(presence); |
| 1182 |
1181 |
| 1183 if (!PURPLE_BUDDY_IS_ONLINE(buddy)) { |
1182 if (!PURPLE_BUDDY_IS_ONLINE(buddy)) { |
| 1184 /* Prevent doubles statues for Offline buddies */ |
1183 /* Prevent doubles statues for Offline buddies */ |
| 1185 /* See: pidgin_get_tooltip_text() in gtkblist.c */ |
1184 /* See: pidgin_get_tooltip_text() in gtkblist.c */ |
| 1186 purple_notify_user_info_remove_last_item(info); |
1185 purple_notify_user_info_remove_last_item(info); |