diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-03-25 15:33:30 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2021-03-25 15:33:30 +0100 |
commit | ca9c946ddc1fa9c57c8ec3b091ad54c5a9986d8f (patch) | |
tree | 90b0aaf5648dcfd684fa3478cdb63d8e92c9795c | |
parent | 2601fc55716355006a5055bc738f14612a2f4dd9 (diff) | |
download | profani-tty-ca9c946ddc1fa9c57c8ec3b091ad54c5a9986d8f.tar.gz |
message: simplify _handle_conference
-rw-r--r-- | src/xmpp/message.c | 12 |
1 files 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); |