From: Art Cancro Date: Tue, 18 Dec 2018 22:43:37 +0000 (-0500) Subject: As per RFC3920 section 7, if an XMPP client does not specify a resource ID, generate... X-Git-Tag: v939~332 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5e630368347015f99043c6edbc8c1b474cf892ff As per RFC3920 section 7, if an XMPP client does not specify a resource ID, generate one. --- diff --git a/citadel/modules/xmpp/serv_xmpp.c b/citadel/modules/xmpp/serv_xmpp.c index 20f2089e3..cc75f6dd1 100644 --- a/citadel/modules/xmpp/serv_xmpp.c +++ b/citadel/modules/xmpp/serv_xmpp.c @@ -403,9 +403,14 @@ void xmpp_xml_end(void *data, const char *supplied_el) { else if ( (XMPP->bind_requested) && (!IsEmptyStr(XMPP->iq_id)) - && (!IsEmptyStr(XMPP->iq_client_resource)) && (CC->logged_in) - ) { + ) { + + /* If the client has not specified a client resource, generate one */ + + if (IsEmptyStr(XMPP->iq_client_resource)) { + generate_uuid(XMPP->iq_client_resource); + } /* Generate the "full JID" of the client resource */ @@ -415,6 +420,10 @@ void xmpp_xml_end(void *data, const char *supplied_el) { XMPP->iq_client_resource ); + /* FIXME look here ... there's nothing before the slash ... wtf? + syslog(LOG_DEBUG, "\033[31m client resource = '%s' \033[0m", XMPP->client_jid); + */ + /* Tell the client what its JID is */ cprintf("", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));