diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-02-12 12:56:34 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-02-12 12:56:34 +0100 |
commit | 7cd1be36f213042b3a94a66ac6f9975d82b5ee1f (patch) | |
tree | adb69f00a45854349b6ad392ab246d432f634be5 /src/xmpp | |
parent | 7ad2e4761be2785b5b11275e2fe019fac9f08094 (diff) | |
download | profani-tty-7cd1be36f213042b3a94a66ac6f9975d82b5ee1f.tar.gz |
xep-0308: Display corrected incoming MUC messages correctly
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/message.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 |