comparison 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
comparison
equal deleted inserted replaced
677:633a0522bd37 678:e175f5d96f04
516 GSList *sl_user; 516 GSList *sl_user;
517 roster *roster_usr, *roster_grp; 517 roster *roster_usr, *roster_grp;
518 518
519 sl_user = roster_find(jid, jidsearch, 519 sl_user = roster_find(jid, jidsearch,
520 ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); 520 ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT);
521 if (sl_user == NULL) 521 // If we can't find it, we add it
522 return; 522 if (sl_user == NULL) {
523 sl_user = roster_add_user(jid, NULL, NULL, ROSTER_TYPE_USER, sub_none);
524 }
523 525
524 roster_usr = (roster*)sl_user->data; 526 roster_usr = (roster*)sl_user->data;
525 roster_grp = (roster*)roster_usr->list->data; 527 roster_grp = (roster*)roster_usr->list->data;
526 if (value) { 528 if (value) {
527 // Message flag is TRUE. This is easy, we just have to set both flags 529 // Message flag is TRUE. This is easy, we just have to set both flags