From e4145d9e9449d1808db303bc0f5c3df4be3ca17e Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 19 Oct 2015 20:23:30 -0300 Subject: 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: Instead of This only deals with incoming typing notifications. See next commit. --- protocols/jabber/jabber_util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index 38daaa26..c3c9df34 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -513,7 +513,11 @@ struct jabber_buddy *jabber_buddy_by_jid(struct im_connection *ic, char *jid_, g jabber_buddy_add(ic, jid_) : NULL; } else if (bud->resource && (flags & GET_BUDDY_EXACT)) { /* We want an exact match, so in thise case there shouldn't be a /resource. */ - return NULL; + if (head != bud && head->resource == NULL) { + return head; + } else { + return NULL; + } } else if (bud->resource == NULL || bud->next == NULL) { /* No need for selection if there's only one option. */ return bud; -- cgit v1.2.3