As per RFC3920 section 7, if an XMPP client does not specify a resource ID, generate...
authorArt Cancro <ajc@citadel.org>
Tue, 18 Dec 2018 22:43:37 +0000 (17:43 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 18 Dec 2018 22:43:37 +0000 (17:43 -0500)
citadel/modules/xmpp/serv_xmpp.c

index 20f2089e33aab30f55098115fb890e41874b2c5a..cc75f6dd190751d88f112fa6c91035277d28c2d2 100644 (file)
@@ -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("<iq type=\"result\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));