xmpp sasl hacks
authorArt Cancro <ajc@citadel.org>
Tue, 27 Nov 2007 20:14:45 +0000 (20:14 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 27 Nov 2007 20:14:45 +0000 (20:14 +0000)
citadel/modules/jabber/serv_xmpp.c
citadel/modules/jabber/serv_xmpp.h

index 8e8a9f4cc59130708b80865f3c03a59b6dcdaf45..a2a0c3643117aa6849745912478b653ffbd1353d 100644 (file)
@@ -186,6 +186,11 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
                        cprintf("</iq>");
                }
 
+               else if (XMPP->iq_session) {
+                       cprintf("<iq type=\"result\" id=\"%s\">", XMPP->iq_bind_id);
+                       cprintf("</iq>");
+               }
+
                else {
                        cprintf("<iq type=\"error\" id=\"%s\">", XMPP->iq_bind_id);
                        cprintf("<error></error>");
@@ -195,6 +200,7 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
                /* Now clear these fields out so they don't get used by a future stanza */
                XMPP->iq_bind_id[0] = 0;
                XMPP->iq_client_resource[0] = 0;
+               XMPP->iq_session = 1;
        }
 
        else if (!strcasecmp(el, "auth")) {
@@ -206,6 +212,10 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
                XMPP->sasl_auth_mech[0] = 0;
        }
 
+       else if (!strcasecmp(el, "session")) {
+               XMPP->iq_session = 1;
+       }
+
        XMPP->chardata_len = 0;
        if (XMPP->chardata_alloc > 0) {
                XMPP->chardata[0] = 0;
index 9898f8a7d8edab8715181c4e7aba561416894fbc..c5fb645c9e441b282657ec9d0cd93722c5ade098 100644 (file)
@@ -13,6 +13,7 @@ struct citxmpp {                      /* Information about the current session */
 
        char iq_bind_id[256];           /* for <iq> stanzas */
        char iq_client_resource[256];   /* resource name requested by the client */
+       int iq_session;                 /* nonzero == client is requesting a session */
 
        char sasl_auth_mech[32];        /* SASL auth mechanism requested by the client */
 };