1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Set message->plain in carbon case

message->plain should always contain something. In the case of the
carbons we forgot to set if rom the body in case it's empy.
This commit is contained in:
Michael Vetter 2019-09-04 10:27:03 +02:00
parent f9addf4f53
commit 09c5f38f11

View File

@ -1008,6 +1008,13 @@ _handle_carbons(xmpp_stanza_t *const stanza)
Jid *jid_from = jid_create(from);
Jid *jid_to = jid_create(to);
if (!message->plain && !message->body) {
log_error("Message received without body from: %s", jid_from->fulljid);
goto out;
} else if (!message->plain) {
message->plain = strdup(message->body);
}
// check for pgp encrypted message
xmpp_stanza_t *x = xmpp_stanza_get_child_by_ns(message_stanza, STANZA_NS_ENCRYPTED);
if (x) {
@ -1029,9 +1036,9 @@ _handle_carbons(xmpp_stanza_t *const stanza)
}
}
out:
message_free(message);
jid_destroy(my_jid);
return TRUE;
}