Ignore:
Timestamp:
2016-03-20T03:58:05Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
3c3b916
Parents:
a42fda4
git-author:
dequis <dx@…> (24-01-16 13:22:08)
git-committer:
dequis <dx@…> (20-03-16 03:58:05)
Message:

jabber: Check for other resources before removing someone from a chat

So if someone has several connections with several clients to a chat,
they won't appear as leaving from the chat until they leave from the
last client.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    ra42fda4 r8f8a56f  
    244244}
    245245
     246static int jabber_chat_has_other_resources(struct im_connection *ic, struct jabber_buddy *bud)
     247{
     248        struct jabber_buddy *cur;
     249
     250        for (cur = jabber_buddy_by_jid(ic, bud->bare_jid, GET_BUDDY_FIRST); cur; cur = cur->next) {
     251                if (cur != bud && jabber_compare_jid(cur->ext_jid, bud->ext_jid)) {
     252                        return TRUE;
     253                }
     254        }
     255       
     256        return FALSE;
     257}
     258
    246259/* Not really the same syntax as the normal pkt_ functions, but this isn't
    247260   called by the xmltree parser directly and this way I can add some extra
     
    333346                }
    334347        } else if (type) { /* type can only be NULL or "unavailable" in this function */
    335                 if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid) {
     348                if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid && !jabber_chat_has_other_resources(ic, bud)) {
    336349                        char *reason = NULL;
    337350                        char *status = NULL;
Note: See TracChangeset for help on using the changeset viewer.