From d9cfa2e48a9798b920c5b528b662d7e7b8e21a0a Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 2 Jul 2020 17:28:48 +0200 Subject: 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. --- src/xmpp/message.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/xmpp') diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 0bb1d4f6..4147a611 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -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); -- cgit 1.4.1-2-gfad0