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

message: simplify _handle_conference

This commit is contained in:
Michael Vetter 2021-03-25 15:33:30 +01:00
parent 2601fc5571
commit ca9c946ddc

View File

@ -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);