Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/skype4pidgin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEion Robb <eion@robbmob.com>2010-03-02 04:53:20 +0300
committerEion Robb <eion@robbmob.com>2010-03-02 04:53:20 +0300
commit176c93148870220afa4cf21684c873dd55db0f7b (patch)
tree7f4d56f3afa6c8442f082dcbd5fa26768a8fd424 /libskype.c
parent73165b0fe48b24a04b3cb40957b6779743807a06 (diff)
Don't delete buddy's from buddylist if they exist in more than one place to fix broken UI's
Diffstat (limited to 'libskype.c')
-rw-r--r--libskype.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libskype.c b/libskype.c
index 4e20a3a..47cf709 100644
--- a/libskype.c
+++ b/libskype.c
@@ -2262,6 +2262,37 @@ skype_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
void
skype_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
{
+ // Check that the buddy doesn't exist in other groups (ie, is the UI being weird)
+ GSList *buddies, *current;
+ PurpleBuddy *otherbuddy;
+ PurpleGroup *othergroup;
+ int group_number;
+
+ buddies = purple_find_buddies(buddy->account, buddy->name);
+ if (buddies == NULL)
+ return;
+
+ for(current = buddies; current; current = g_slist_next(current))
+ {
+ otherbuddy = current->data;
+ if (otherbuddy == NULL)
+ continue;
+ othergroup = purple_buddy_get_group(otherbuddy);
+ if (othergroup == NULL)
+ continue;
+ if (!g_str_equal(othergroup->name, group->name))
+ {
+ //If we're here, we've found the buddy in another group, just remove them from this group for now
+ group_number = skype_find_group_with_name(group->name);
+ if (group_number)
+ skype_send_message_nowait("ALTER GROUP %d REMOVEUSER %s", group_number, buddy->name);
+ g_slist_free(buddies);
+ return;
+ }
+ }
+ g_slist_free(buddies);
+
+ //If we're here, the buddy was only in that one group, so remove them completely
skype_send_message_nowait("SET USER %s BUDDYSTATUS 1", buddy->name);
}