From ca9c946ddc1fa9c57c8ec3b091ad54c5a9986d8f Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 25 Mar 2021 15:33:30 +0100 Subject: [PATCH] message: simplify _handle_conference --- src/xmpp/message.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 884d63a1..55059c74 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -937,6 +937,11 @@ _handle_conference(xmpp_stanza_t* const stanza) xmpp_stanza_t* xns_conference = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CONFERENCE); if (xns_conference) { + // XEP-0249 + const char* room = xmpp_stanza_get_attribute(xns_conference, STANZA_ATTR_JID); + if (!room) { + return; + } const char* from = xmpp_stanza_get_from(stanza); if (!from) { @@ -949,13 +954,6 @@ _handle_conference(xmpp_stanza_t* const stanza) return; } - // XEP-0249 - const char* room = xmpp_stanza_get_attribute(xns_conference, STANZA_ATTR_JID); - if (!room) { - jid_destroy(jidp); - return; - } - // reason and password are both optional const char* reason = xmpp_stanza_get_attribute(xns_conference, STANZA_ATTR_REASON); const char* password = xmpp_stanza_get_attribute(xns_conference, STANZA_ATTR_PASSWORD);