Changeset 5307e88 for protocols


Ignore:
Timestamp:
2015-10-21T06:24:08Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
72d661e
Parents:
0c78bb7
Message:

jabber: Fix XEP85 detection (typing) between two bitlbee users

Fixes trac ticket 1143: https://bugs.bitlbee.org/bitlbee/ticket/1143

The "correct" way to discover XEP85 support is to send a discovery
query. We take a more conservative approach: if the irc client claims to
support typing (by sending CTCP TYPING at least once), we send an
<active> tag along with next chat message, and set JBFLAG_PROBED_XEP85.
The logic for that stuff is in jabber_buddy_msg().

That's all neat and clever and actually works fine. What was broken was
the detection side. Whenever a <composing>, <active> or <pause> is
received, the buddy is marked as supporting XEP85. However the <active>
tag had an additional check:

/* No need to send a "stopped typing" signal when there's a message. */
else if (xt_find_node(node->children, "active") && (body == NULL)) {

It skipped the tag completely if it had a message too.

This was changed to move the body == NULL condition inside, so that the
flag is set.

Took me longer to write this message than the diff itself. But even
longer to actually decide to debug this behavior. I'm the one who
submitted that ticket, one year and a half ago. Yep.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/message.c

    r0c78bb7 r5307e88  
    142142                        imcb_buddy_typing(ic, from, OPT_TYPING);
    143143                }
    144                 /* No need to send a "stopped typing" signal when there's a message. */
    145                 else if (xt_find_node(node->children, "active") && (body == NULL)) {
     144                else if (xt_find_node(node->children, "active")) {
    146145                        bud->flags |= JBFLAG_DOES_XEP85;
    147                         imcb_buddy_typing(ic, from, 0);
     146
     147                        /* No need to send a "stopped typing" signal when there's a message. */
     148                        if (body == NULL) {
     149                                imcb_buddy_typing(ic, from, 0);
     150                        }
    148151                } else if (xt_find_node(node->children, "paused")) {
    149152                        bud->flags |= JBFLAG_DOES_XEP85;
Note: See TracChangeset for help on using the changeset viewer.