mirror of
https://github.com/msantos/xmppipe
synced 2024-11-16 00:12:59 +00:00
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".
This commit is contained in:
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…
Reference in New Issue
Block a user