aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-10-21 03:24:08 -0300
committerdequis <dx@dxzone.com.ar>2015-10-21 03:24:08 -0300
commit5307e8870a1a4aea9da534b009190246a8b6e9f0 (patch)
tree70b97c674f5f9982f4990fccb1f99a3ee27db169
parent0c78bb7298a9fe6ea5ce0703aa26a2b01fb87f5c (diff)
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.
-rw-r--r--protocols/jabber/message.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/jabber/message.c b/protocols/jabber/message.c
index 1b47693b..7c40f3e0 100644
--- a/protocols/jabber/message.c
+++ b/protocols/jabber/message.c
@@ -141,10 +141,13 @@ xt_status jabber_pkt_message(struct xt_node *node, gpointer data)
bud->flags |= JBFLAG_DOES_XEP85;
imcb_buddy_typing(ic, from, OPT_TYPING);
}
- /* No need to send a "stopped typing" signal when there's a message. */
- else if (xt_find_node(node->children, "active") && (body == NULL)) {
+ else if (xt_find_node(node->children, "active")) {
bud->flags |= JBFLAG_DOES_XEP85;
- imcb_buddy_typing(ic, from, 0);
+
+ /* No need to send a "stopped typing" signal when there's a message. */
+ if (body == NULL) {
+ imcb_buddy_typing(ic, from, 0);
+ }
} else if (xt_find_node(node->children, "paused")) {
bud->flags |= JBFLAG_DOES_XEP85;
imcb_buddy_typing(ic, from, OPT_THINKING);