comparison mcabber/src/roster.c @ 509:cd52ddef5ce1

Fix a bug when moving a chatroom to a new group Room "subscription" and "nickname" fields were lost.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 12 Nov 2005 15:02:25 +0100
parents 74dcd0df532e
children 6c3cd3aa4a91
comparison
equal deleted inserted replaced
508:5a2132ba2220 509:cd52ddef5ce1
695 695
696 // Add the buddy to its new group; actually we "clone" this buddy... 696 // Add the buddy to its new group; actually we "clone" this buddy...
697 sl_clone = roster_add_user(roster_usr->jid, roster_usr->name, 697 sl_clone = roster_add_user(roster_usr->jid, roster_usr->name,
698 newgroupname, roster_usr->type); 698 newgroupname, roster_usr->type);
699 roster_clone = (roster*)sl_clone->data; 699 roster_clone = (roster*)sl_clone->data;
700 roster_clone->subscription = roster_usr->subscription;
700 roster_clone->flags = roster_usr->flags; 701 roster_clone->flags = roster_usr->flags;
702
701 roster_clone->resource = roster_usr->resource; 703 roster_clone->resource = roster_usr->resource;
702 roster_usr->resource = NULL; 704 roster_usr->resource = NULL;
705 roster_clone->nickname = roster_usr->nickname;
706 roster_usr->nickname = NULL;
703 707
704 // Free old buddy 708 // Free old buddy
705 if (roster_usr->jid) g_free((gchar*)roster_usr->jid); 709 if (roster_usr->jid) g_free((gchar*)roster_usr->jid);
706 if (roster_usr->name) g_free((gchar*)roster_usr->name); 710 if (roster_usr->name) g_free((gchar*)roster_usr->name);
707 if (roster_usr->nickname) g_free((gchar*)roster_usr->nickname); 711 if (roster_usr->nickname) g_free((gchar*)roster_usr->nickname);