chat: fix segfault when checking origin

strcmp(3) segfaulted when comparing the from address to NULL.

Checking messages originated from the output account only makes sense
with groupchat. Remove the check for type of "chat".
master
Michael Santos 6 years ago
parent dbbf6e5f5e
commit a10b4bd84c

@ -1071,9 +1071,7 @@ handle_message(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
return 1;
/* Check if the message is from us */
if (XMPPIPE_STREQ(type,
state->opt & XMPPIPE_OPT_GROUPCHAT ? "groupchat" : "chat")
&& XMPPIPE_STREQ(from, state->mucjid))
if (XMPPIPE_STREQ(type, "groupchat") && XMPPIPE_STREQ(from, state->mucjid))
return 1;
child = xmpp_stanza_get_child_by_name(stanza, "body");

Loading…
Cancel
Save