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.
This commit is contained in:
Holger Weiß
2019-08-20 17:51:26 +02:00
parent d8d6aa4b88
commit 3228ab47d3
3 changed files with 20 additions and 2 deletions

View File

@@ -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);