changeset 331:1510dda4ad71

Don't loose alternate_buddy when the buddy is moved ("/move")
author Mikael Berthe <mikael@lilotux.net>
date Sun, 17 Jul 2005 22:21:51 +0100
parents a9013124ede6
children a1901741890e
files mcabber/src/roster.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/roster.c	Sun Jul 17 21:17:52 2005 +0100
+++ b/mcabber/src/roster.c	Sun Jul 17 22:21:51 2005 +0100
@@ -531,6 +531,7 @@
   GSList **sl_group;
   GSList *sl_clone;
   roster *roster_clone;
+  int is_alternate;
 
   // A group has no group :)
   if (roster_usr->type & ROSTER_TYPE_GROUP) return;
@@ -557,8 +558,11 @@
   ((roster*)((GSList*)roster_clone->list)->data)->flags &= ~ROSTER_FLAG_HIDE;
 
   // Little trick to have current_body pointing to the cloned buddy
+  is_alternate = (alternate_buddy == current_buddy);
   buddylist = g_list_append(buddylist, roster_clone);
   current_buddy = g_list_find(buddylist, roster_clone);
+  if (is_alternate)
+    alternate_buddy = current_buddy;
 
   buddylist_build();
 }