Changeset e4145d9 for protocols


Ignore:
Timestamp:
2015-10-21T06:05:01Z (4 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0c78bb7
Parents:
532efdf
git-author:
dequis <dx@…> (19-10-15 23:23:30)
git-committer:
dequis <dx@…> (21-10-15 06:05:01)
Message:

jabber: Fix incoming google talk typing notifications

jabber_buddy_by_jid() does the following:

head = g_hash_table_lookup(jd->buddies, jid);
bud = (head && head->next) ? head->next : head;

'head' has the one without resource, 'bud' has the first resource.

So if a resource is available, it uses it and ignores the head.
When asked for a bare JID (with no resource) and GET_BUDDY_EXACT, it
shouldn't do this, but it should return the head.

In other words, the problem was a message in this format:

<message from="username@…" ...>

Instead of

<message from="username@…/resource" ...>

This only deals with incoming typing notifications. See next commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    r532efdf re4145d9  
    514514                } else if (bud->resource && (flags & GET_BUDDY_EXACT)) {
    515515                        /* We want an exact match, so in thise case there shouldn't be a /resource. */
    516                         return NULL;
     516                        if (head != bud && head->resource == NULL) {
     517                                return head;
     518                        } else {
     519                                return NULL;
     520                        }
    517521                } else if (bud->resource == NULL || bud->next == NULL) {
    518522                        /* No need for selection if there's only one option. */
Note: See TracChangeset for help on using the changeset viewer.