diff mcabber/src/roster.c @ 678:e175f5d96f04

Fix a small issue in roster_msg_setflag() Add a roster item when there is none and the new_message flag is requested.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 28 Jan 2006 12:02:14 +0100
parents 2cd0805515a4
children ee03b56b93ee
line wrap: on
line diff
--- a/mcabber/src/roster.c	Sat Jan 28 11:07:02 2006 +0100
+++ b/mcabber/src/roster.c	Sat Jan 28 12:02:14 2006 +0100
@@ -518,8 +518,10 @@
 
   sl_user = roster_find(jid, jidsearch,
                         ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT);
-  if (sl_user == NULL)
-    return;
+  // If we can't find it, we add it
+  if (sl_user == NULL) {
+    sl_user = roster_add_user(jid, NULL, NULL, ROSTER_TYPE_USER, sub_none);
+  }
 
   roster_usr = (roster*)sl_user->data;
   roster_grp = (roster*)roster_usr->list->data;