Mercurial > pidgin
diff libpurple/protocols/bonjour/buddy.c @ 22975:d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
"Bonjour" group. Thanks to Eion Robb for the patch (blame me if something is
broken as I tweaked a few things). Fixes #5753.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 16 May 2008 18:21:09 +0000 |
parents | 41959f031322 |
children | ef0bcbe33689 |
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/buddy.c Fri May 16 16:04:05 2008 +0000 +++ b/libpurple/protocols/bonjour/buddy.c Fri May 16 18:21:09 2008 +0000 @@ -153,11 +153,12 @@ if (buddy == NULL) { buddy = purple_buddy_new(account, bonjour_buddy->name, NULL); - buddy->proto_data = bonjour_buddy; purple_blist_node_set_flags((PurpleBlistNode *)buddy, PURPLE_BLIST_NODE_FLAG_NO_SAVE); purple_blist_add_buddy(buddy, NULL, group, NULL); } - + + buddy->proto_data = bonjour_buddy; + /* Create the alias for the buddy using the first and the last name */ if (bonjour_buddy->nick) serv_got_alias(purple_account_get_connection(account), buddy->name, bonjour_buddy->nick); @@ -201,6 +202,20 @@ } /** + * The buddy has signed off Bonjour. + * If the buddy is being saved, mark as offline, otherwise delete + */ +void bonjour_buddy_signed_off(PurpleBuddy *pb) { + if (PURPLE_BLIST_NODE_SHOULD_SAVE(pb)) + purple_prpl_got_user_status(purple_buddy_get_account(pb), + purple_buddy_get_name(pb), "offline", NULL); + else { + purple_account_remove_buddy(purple_buddy_get_account(pb), pb, NULL); + purple_blist_remove_buddy(pb); + } +} + +/** * We got the buddy icon data; deal with it */ void bonjour_buddy_got_buddy_icon(BonjourBuddy *buddy, gconstpointer data, gsize len) {