Commits

Mikael Berthe committed 4a10c04

Fix a bug in roster_find()

Comments (0)

Files changed (2)

mcabber/src/hooks.c

   }
 
   // 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);

mcabber/src/roster.c

     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;