aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/conference.c
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-12-27 14:13:51 +0100
committerMarius Halden <marius.h@lden.org>2016-12-27 14:13:51 +0100
commitd35affbcea87f453fb20c4bb545a10b668eae81b (patch)
treea6856cc15f6ba10c79d737a61e2773cba12bf558 /protocols/jabber/conference.c
parent184c46d3507a0ff9fc68a4409f690add96cd183d (diff)
parent9cdcef077ed523966f508a3721944a16425734cb (diff)
Merge branch 'master' into patched-master
Diffstat (limited to 'protocols/jabber/conference.c')
-rw-r--r--protocols/jabber/conference.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c
index 593e4233..75f3100c 100644
--- a/protocols/jabber/conference.c
+++ b/protocols/jabber/conference.c
@@ -166,6 +166,7 @@ void jabber_chat_free(struct groupchat *c)
jabber_buddy_remove_bare(c->ic, jc->name);
+ g_free(jc->last_sent_message);
g_free(jc->my_full_jid);
g_free(jc->name);
g_free(jc->invite);
@@ -187,6 +188,9 @@ int jabber_chat_msg(struct groupchat *c, char *message, int flags)
jabber_cache_add(ic, node, jabber_chat_self_message);
+ g_free(jc->last_sent_message);
+ jc->last_sent_message = g_strdup(message);
+
return !jabber_write_packet(ic, node);
}
@@ -493,10 +497,16 @@ void jabber_chat_pkt_message(struct im_connection *ic, struct jabber_buddy *bud,
} else if (chat != NULL && bud == NULL && nick == NULL) {
imcb_chat_log(chat, "From conference server: %s", body->text);
return;
- } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me &&
- (jabber_cache_handle_packet(ic, node) == XT_ABORT)) {
- /* Self message marked by this bitlbee, don't show it */
- return;
+ } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me) {
+ if (jabber_cache_handle_packet(ic, node) == XT_ABORT) {
+ /* Self message marked by this bitlbee, don't show it */
+ return;
+ } else if (xt_find_attr(node, "id") == NULL &&
+ g_strcmp0(body->text, jc->last_sent_message) == 0) {
+ /* Some misbehaving servers (like slack) eat the ids and echo anyway.
+ * Try to detect those cases by comparing against the last sent message. */
+ return;
+ }
}
if (bud) {