diff options
author | dequis <dx@dxzone.com.ar> | 2015-10-21 03:05:17 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-10-21 03:05:17 -0300 |
commit | 0c78bb7298a9fe6ea5ce0703aa26a2b01fb87f5c (patch) | |
tree | bf90ff2104a526a47ed4038f1ed35dbdf014c9a7 /protocols/jabber/jabber.c | |
parent | e4145d9e9449d1808db303bc0f5c3df4be3ca17e (diff) |
jabber: Fix outgoing google talk typing notifications
Since bare JIDs from typing notifications are now accepted, the other
buddy objects never get the flag JBFLAG_DOES_XEP85 set. This fixes it by
checking both the buddy with resource and the bare one, with the
implication that if the bare JID has that flag, all other resources get
typing notifications.
Follow up to the previous commit, splitting since they are actually
unrelated fixes, although this one is a consequence of the previous one.
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r-- | protocols/jabber/jabber.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 47e90d90..c1e55a78 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -591,20 +591,23 @@ static void jabber_keepalive(struct im_connection *ic) static int jabber_send_typing(struct im_connection *ic, char *who, int typing) { struct jabber_data *jd = ic->proto_data; - struct jabber_buddy *bud; + struct jabber_buddy *bud, *bare; /* Enable typing notification related code from now. */ jd->flags |= JFLAG_WANT_TYPING; - if ((bud = jabber_buddy_by_jid(ic, who, 0)) == NULL) { + if ((bud = jabber_buddy_by_jid(ic, who, 0)) == NULL || + (bare = jabber_buddy_by_jid(ic, who, GET_BUDDY_BARE)) == NULL) { /* Sending typing notifications to unknown buddies is unsupported for now. Shouldn't be a problem, I think. */ return 0; } - if (bud->flags & JBFLAG_DOES_XEP85) { + + if (bud->flags & JBFLAG_DOES_XEP85 || bare->flags & JBFLAG_DOES_XEP85) { /* We're only allowed to send this stuff if we know the other - side supports it. */ + side supports it. If the bare JID has the flag, all other + resources get it, too (That is the case in gtalk) */ struct xt_node *node; char *type; |