432 GSList *sl_user, *sl_group; |
432 GSList *sl_user, *sl_group; |
433 GSList **sl_group_listptr; |
433 GSList **sl_group_listptr; |
434 roster *roster_usr; |
434 roster *roster_usr; |
435 GSList *node; |
435 GSList *node; |
436 |
436 |
437 sl_user = roster_find(jid, jidsearch, |
437 sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); |
438 ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM); |
|
439 if (sl_user == NULL) |
438 if (sl_user == NULL) |
440 return; |
439 return; |
441 roster_usr = (roster*)sl_user->data; |
440 roster_usr = (roster*)sl_user->data; |
442 |
441 |
443 // Remove (if present) from unread messages list |
442 // Remove (if present) from unread messages list |
445 if (node) unread_list = g_slist_delete_link(unread_list, node); |
444 if (node) unread_list = g_slist_delete_link(unread_list, node); |
446 // If there is a pending unread message, keep track of it |
445 // If there is a pending unread message, keep track of it |
447 if (roster_usr->flags & ROSTER_FLAG_MSG) |
446 if (roster_usr->flags & ROSTER_FLAG_MSG) |
448 unread_jid_add(roster_usr->jid); |
447 unread_jid_add(roster_usr->jid); |
449 |
448 |
|
449 sl_group = roster_usr->list; |
|
450 |
450 // Let's free roster_usr memory (jid, name, status message...) |
451 // Let's free roster_usr memory (jid, name, status message...) |
451 free_roster_user_data(roster_usr); |
452 free_roster_user_data(roster_usr); |
452 |
453 |
453 // That's a little complex, we need to dereference twice |
454 // That's a little complex, we need to dereference twice |
454 sl_group = ((roster*)sl_user->data)->list; |
|
455 sl_group_listptr = &((roster*)(sl_group->data))->list; |
455 sl_group_listptr = &((roster*)(sl_group->data))->list; |
456 *sl_group_listptr = g_slist_delete_link(*sl_group_listptr, sl_user); |
456 *sl_group_listptr = g_slist_delete_link(*sl_group_listptr, sl_user); |
457 |
457 |
458 // We need to rebuild the list |
458 // We need to rebuild the list |
459 if (current_buddy) |
459 if (current_buddy) |