about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-09-30 10:01:19 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-09-30 10:01:19 +0200
commit6ab6fe86490efc823e7f73da068fddbfcef7a0f7 (patch)
treee8e8046ed3e419a86f6492eb2f75eb49ae658ae1
parent6161235733ad6deeaf2aef2c8e0b9341d6acf4b3 (diff)
downloadprofani-tty-6ab6fe86490efc823e7f73da068fddbfcef7a0f7.tar.gz
Detect MUC history correctly with some Prosody versions
Some versions of prosody send the domainpart.
See https://issues.prosody.im/1416

Workaround to handle those cases.
Thanks to Holger Weiss for helping with this!

Fix https://github.com/profanity-im/profanity/issues/1190
-rw-r--r--src/xmpp/message.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 8a711e90..ac688a41 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -823,7 +823,9 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
     // determine if the notifications happened whilst offline
     gchar *from;
     message->timestamp = stanza_get_delay_from(stanza, &from);
-    if (message->timestamp && g_strcmp0(jid->barejid, from) == 0) {
+    // checking the domainpart is a workaround for some prosody versions (gh#1190)
+    if (message->timestamp && (g_strcmp0(jid->barejid, from) == 0
+                || g_strcmp0(jid->domainpart, from) == 0)) {
         sv_ev_room_history(message);
     } else {
         sv_ev_room_message(message);