From 7cd1be36f213042b3a94a66ac6f9975d82b5ee1f Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 12 Feb 2020 12:56:34 +0100 Subject: xep-0308: Display corrected incoming MUC messages correctly --- src/xmpp/message.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/xmpp') diff --git a/src/xmpp/message.c b/src/xmpp/message.c index b1dc829e..7b10376e 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -827,13 +827,23 @@ _handle_groupchat(xmpp_stanza_t *const stanza) ProfMessage *message = message_init(); message->jid = jid; + if (id) { message->id = strdup(id); } + if (originid) { message->originid = strdup(originid); } + xmpp_stanza_t *replace_id_stanza = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_LAST_MESSAGE_CORRECTION); + if (replace_id_stanza) { + const char *replace_id = xmpp_stanza_get_id(replace_id_stanza); + if (replace_id) { + message->replace_id = strdup(replace_id); + } + } + message->body = xmpp_message_get_body(stanza); // check omemo encryption -- cgit 1.4.1-2-gfad0