1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

message.c: Break out of _message_handler() after handling code

AFAIK it can only be one.
Except at STANZA_NS_MUC_USER which is used in several cases.
This commit is contained in:
Michael Vetter 2020-07-02 17:28:48 +02:00
parent ad3dd72325
commit d9cfa2e48a

View File

@ -146,24 +146,28 @@ _message_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *con
xmpp_stanza_t *conference = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CONFERENCE);
if (conference) {
_handle_conference(stanza);
return 1;
}
// XEP-0158: CAPTCHA Forms
xmpp_stanza_t *captcha = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CAPTCHA);
if (captcha) {
_handle_captcha(stanza);
return 1;
}
// XEP-0184: Message Delivery Receipts
xmpp_stanza_t *receipts = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_RECEIPTS);
if (receipts) {
_handle_receipt_received(stanza);
return 1;
}
// XEP-0060: Publish-Subscribe
xmpp_stanza_t *event = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_PUBSUB_EVENT);
if (event) {
_handle_pubsub(stanza, event);
return 1;
}
_handle_chat(stanza, FALSE);