1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

xep-0308: correct incoming MUC PMs

This commit is contained in:
Michael Vetter 2020-02-12 13:07:52 +01:00
parent 7cd1be36f2
commit ed1d49bf0c

View File

@ -966,6 +966,20 @@ _private_chat_handler(xmpp_stanza_t *const stanza)
const gchar *from = xmpp_stanza_get_from(stanza); const gchar *from = xmpp_stanza_get_from(stanza);
message->jid = jid_create(from); message->jid = jid_create(from);
// message stanza id
const char *id = xmpp_stanza_get_id(stanza);
if (id) {
message->id = strdup(id);
}
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);
}
}
// check omemo encryption // check omemo encryption
#ifdef HAVE_OMEMO #ifdef HAVE_OMEMO
message->plain = omemo_receive_message(stanza, &message->trusted); message->plain = omemo_receive_message(stanza, &message->trusted);