about summary refs log tree commit diff stats
path: root/src/xmpp/message.c
diff options
context:
space:
mode:
authorHolger Weiß <holger@zedat.fu-berlin.de>2019-08-20 17:51:26 +0200
committerHolger Weiß <holger@zedat.fu-berlin.de>2019-08-20 17:51:26 +0200
commit3228ab47d341f477aad7a03093807d4324ec9f68 (patch)
treefc448c61f5e51c40fc218ba30ee5343ae77644ad /src/xmpp/message.c
parentd8d6aa4b888a6a19133e5a48a32387451afdca44 (diff)
downloadprofani-tty-3228ab47d341f477aad7a03093807d4324ec9f68.tar.gz
Don't render (all) delayed messages as MUC history
Double-check that a <delay/> tag on a groupchat message was actually
added by the MUC service (rather than the sending client) before
assuming it was received from the MUC history.

Fixes #1173.
Diffstat (limited to 'src/xmpp/message.c')
-rw-r--r--src/xmpp/message.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index fd2b8e51..033a7a11 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -821,12 +821,14 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
     }
 
     // determine if the notifications happened whilst offline
-    message->timestamp = stanza_get_delay(stanza);
-    if (message->timestamp) {
+    gchar *from;
+    message->timestamp = stanza_get_delay_from(stanza, &from);
+    if (message->timestamp && g_strcmp0(jid->barejid, from) == 0) {
         sv_ev_room_history(message);
     } else {
         sv_ev_room_message(message);
     }
+    g_free(from);
 
 out:
     message_free(message);