]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/xmpp/serv_xmpp.c
comment change
[citadel.git] / citadel / modules / xmpp / serv_xmpp.c
index e0b61af64413e38b7978d4b42d0f5388cd2ef71a..2bbfcff1f0ff8258256dec8a05efc6d3f6bb4d87 100644 (file)
@@ -392,8 +392,7 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
                        xmpp_non_sasl_authenticate(
                                XMPP->iq_id,
                                XMPP->iq_client_username,
-                               XMPP->iq_client_password,
-                               XMPP->iq_client_resource
+                               XMPP->iq_client_password
                        );
                }       
 
@@ -407,26 +406,14 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
                ) {
 
                        /* If the client has not specified a client resource, generate one */
-
                        if (IsEmptyStr(XMPP->iq_client_resource)) {
-                               generate_uuid(XMPP->iq_client_resource);
+                               snprintf(XMPP->iq_client_resource, sizeof XMPP->iq_client_resource, "%d", CC->cs_pid);
                        }
 
-                       /* Generate the "full JID" of the client resource */
-
-                       if (IsEmptyStr(CC->cs_inet_email)) {                            // synthetic user@host if no email is set
-                               snprintf(XMPP->client_jid, sizeof XMPP->client_jid,
-                                       "%ld@%s/%s", CC->user.usernum, CtdlGetConfigStr("c_fqdn"), XMPP->iq_client_resource
-                               );
-                       }
-                       else {                                                          // use the email address if we have it
-                               snprintf(XMPP->client_jid, sizeof XMPP->client_jid,
-                                       "%s/%s", CC->cs_inet_email, XMPP->iq_client_resource
-                               );
-                       }
+                       /* Generate the "full JID" of the client (user@host/resource) */
+                       snprintf(XMPP->client_jid, sizeof XMPP->client_jid, "%s/%s", CC->cs_inet_email, XMPP->iq_client_resource);
 
                        /* Tell the client what its JID is */
-
                        cprintf("<iq type=\"result\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));
                        cprintf("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\">");
                        cprintf("<jid>%s</jid>", xmlesc(xmlbuf, XMPP->client_jid, sizeof xmlbuf));