1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1147 from paulfariello/hotfix/fix-private-message-handling

Fix plaintext private message handling
Regards #1144
This commit is contained in:
Michael Vetter 2019-07-04 14:33:43 +02:00 committed by GitHub
commit 593aac8a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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