From 1eea6f43dabd6a4474044b7c2b7752f95785973a Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Thu, 13 Jan 2011 22:02:02 +0100 Subject: [PATCH] Fix sipe_buddy_menu_copy_to_cb when copying buddy not yet in our list When having IM session with someone not in our buddy list, right click on header of the conversation pane and selecting Copy To>(Group Name) adds the contact to list, but is permanently shown as offline and is erased again when client restarts. Call sipe_add_buddy instead of sipe_group_buddy. sipe_buddy is then created when needed, we subscribe to its presence and add it to contact list on server. --- src/core/sipe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/sipe.c b/src/core/sipe.c index ed5778a4..c764a0f7 100644 --- a/src/core/sipe.c +++ b/src/core/sipe.c @@ -1084,13 +1084,14 @@ void sipe_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group b->name = g_strdup(buddy->name); b->just_added = TRUE; g_hash_table_insert(sipe_private->buddies, b->name, b); - sipe_group_buddy(gc, b->name, NULL, group->name); /* @TODO should go to callback */ sipe_subscribe_presence_single(sipe_private, b->name); } else { SIPE_DEBUG_INFO("sipe_add_buddy: buddy %s already in internal list", buddy->name); } + + sipe_group_buddy(gc, buddy->name, NULL, group->name); } } @@ -6261,10 +6262,10 @@ sipe_buddy_menu_copy_to_cb(PurpleBlistNode *node, const char *group_name) b = purple_find_buddy_in_group(buddy->account, buddy->name, group); if (!b){ - purple_blist_add_buddy_clone(group, buddy); + b = purple_blist_add_buddy_clone(group, buddy); } - sipe_group_buddy(gc, buddy->name, NULL, group_name); + sipe_add_buddy(gc, b, group); } static void -- 2.11.4.GIT