changeset 860:a8fadbd97858

Rebuild buddylist when setting a new message flag
author Mikael Berthe <mikael@lilotux.net>
date Sun, 21 May 2006 09:47:12 +0200
parents cb2a3a1d985f
children e1adea19ba14
files mcabber/src/roster.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/roster.c	Sat May 20 19:27:45 2006 +0200
+++ b/mcabber/src/roster.c	Sun May 21 09:47:12 2006 +0200
@@ -533,12 +533,14 @@
 {
   GSList *sl_user;
   roster *roster_usr, *roster_grp;
+  int new_roster_item = FALSE;
 
   sl_user = roster_find(jid, jidsearch,
                         ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT);
   // 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);
+    new_roster_item = TRUE;
   }
 
   roster_usr = (roster*)sl_user->data;
@@ -579,6 +581,9 @@
       // Actually the "else" part is useless, because the group
       // ROSTER_FLAG_MSG should already be set...
   }
+
+  if (buddylist && new_roster_item)
+    buddylist_build();
 }
 
 const char *roster_getname(const char *jid)