changeset 1389:cefda9174d62

Fix an old bug in roster_del_user()
author Mikael Berthe <mikael@lilotux.net>
date Tue, 04 Dec 2007 22:47:06 +0100
parents 40371a7d49f4
children 753a348c65c1
files mcabber/src/roster.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/roster.c	Tue Dec 04 19:38:24 2007 +0100
+++ b/mcabber/src/roster.c	Tue Dec 04 22:47:06 2007 +0100
@@ -434,8 +434,7 @@
   roster *roster_usr;
   GSList *node;
 
-  sl_user = roster_find(jid, jidsearch,
-                        ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM);
+  sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT);
   if (sl_user == NULL)
     return;
   roster_usr = (roster*)sl_user->data;
@@ -447,11 +446,12 @@
   if (roster_usr->flags & ROSTER_FLAG_MSG)
     unread_jid_add(roster_usr->jid);
 
+  sl_group = roster_usr->list;
+
   // Let's free roster_usr memory (jid, name, status message...)
   free_roster_user_data(roster_usr);
 
   // That's a little complex, we need to dereference twice
-  sl_group = ((roster*)sl_user->data)->list;
   sl_group_listptr = &((roster*)(sl_group->data))->list;
   *sl_group_listptr = g_slist_delete_link(*sl_group_listptr, sl_user);