changeset 483:4a10c04ac2fb

Fix a bug in roster_find()
author Mikael Berthe <mikael@lilotux.net>
date Wed, 05 Oct 2005 21:46:13 +0200
parents 2ea7591584ab
children 00e2d3821a5b
files mcabber/src/hooks.c mcabber/src/roster.c
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/hooks.c	Wed Oct 05 19:30:35 2005 +0200
+++ b/mcabber/src/hooks.c	Wed Oct 05 21:46:13 2005 +0200
@@ -57,8 +57,7 @@
   }
 
   // If this user isn't in the roster, we add it
-  roster_usr = roster_find(jid, jidsearch,
-                           rtype|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM);
+  roster_usr = roster_find(jid, jidsearch, 0);
   if (!roster_usr) {
     new_guy = TRUE;
     roster_usr = roster_add_user(jid, NULL, NULL, rtype);
--- a/mcabber/src/roster.c	Wed Oct 05 19:30:35 2005 +0200
+++ b/mcabber/src/roster.c	Wed Oct 05 21:46:13 2005 +0200
@@ -215,11 +215,9 @@
     if (roster_type & ROSTER_TYPE_GROUP) {
       if ((type == namesearch) && !strcasecmp(jidname, roster_elt->name))
         return sl_roster_elt;
-    } else {
-      res = g_slist_find_custom(roster_elt->list, &sample, comp);
-      if (res)
-        return res;
     }
+    res = g_slist_find_custom(roster_elt->list, &sample, comp);
+    if (res) return res;
     sl_roster_elt = g_slist_next(sl_roster_elt);
   }
   return NULL;