about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-02-12 12:56:34 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-02-12 12:56:34 +0100
commit7cd1be36f213042b3a94a66ac6f9975d82b5ee1f (patch)
treeadb69f00a45854349b6ad392ab246d432f634be5 /src/xmpp
parent7ad2e4761be2785b5b11275e2fe019fac9f08094 (diff)
downloadprofani-tty-7cd1be36f213042b3a94a66ac6f9975d82b5ee1f.tar.gz
xep-0308: Display corrected incoming MUC messages correctly
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/message.c10
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