mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Fix a segfault when carbon has no body
This commit is contained in:
parent
4fa5fbaea4
commit
45e8467231
@ -1004,17 +1004,19 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
|||||||
message->encrypted = xmpp_stanza_get_text(x);
|
message->encrypted = xmpp_stanza_get_text(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we are the recipient, treat as standard incoming message
|
if (message->plain || message->encrypted || message->body) {
|
||||||
if (g_strcmp0(my_jid->barejid, jid_to->barejid) == 0) {
|
// if we are the recipient, treat as standard incoming message
|
||||||
jid_destroy(jid_to);
|
if (g_strcmp0(my_jid->barejid, jid_to->barejid) == 0) {
|
||||||
message->jid = jid_from;
|
jid_destroy(jid_to);
|
||||||
sv_ev_incoming_carbon(message);
|
message->jid = jid_from;
|
||||||
|
sv_ev_incoming_carbon(message);
|
||||||
|
|
||||||
// else treat as a sent message
|
// else treat as a sent message
|
||||||
} else {
|
} else {
|
||||||
jid_destroy(jid_from);
|
jid_destroy(jid_from);
|
||||||
message->jid = jid_to;
|
message->jid = jid_to;
|
||||||
sv_ev_outgoing_carbon(message);
|
sv_ev_outgoing_carbon(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message_free(message);
|
message_free(message);
|
||||||
|
Loading…
Reference in New Issue
Block a user