1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Set plain message in _private_chat_handler

In case that plain is NULL we need to copy over from body.

Fix https://github.com/profanity-im/profanity/issues/1144
This commit is contained in:
Michael Vetter 2019-07-03 15:16:19 +02:00
parent ad9263520e
commit 19902e8e21

View File

@ -922,6 +922,13 @@ _private_chat_handler(xmpp_stanza_t *const stanza)
}
#endif
if (!message->plain && !message->body) {
log_error("Message received without body from: %s", jid->str);
goto out;
} else if (!message->plain) {
message->plain = strdup(message->body);
}
message->timestamp = stanza_get_delay(stanza);
message->body = xmpp_message_get_body(stanza);