xep-0308: enable for carbon copied messages

If we are connected with another client and send a message, then correct
it. We now display it correctly in Profanity.

Id wasn't saved for carbon copied messages too so far.
This commit is contained in:
Michael Vetter
2020-02-13 12:54:31 +01:00
parent 9b3593bdf9
commit e27c414f1f
2 changed files with 15 additions and 1 deletions

View File

@@ -1055,6 +1055,21 @@ _handle_carbons(xmpp_stanza_t *const stanza)
message->mucuser = TRUE;
}
// id
const char *id = xmpp_stanza_get_id(message_stanza);
if (id) {
message->id = strdup(id);
}
// replace id
xmpp_stanza_t *replace_id_stanza = xmpp_stanza_get_child_by_ns(message_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);
}
}
// check omemo encryption
#ifdef HAVE_OMEMO
message->plain = omemo_receive_message(message_stanza, &message->trusted);