Before authentication, the only feature we offer is SASL, implying to
the client that the only thing it is allowed to do is log in. After
a successful SASL authentication, which causes the XMPP stream to be
restarted, the features we offer are sessions and binding, but not
SASL. This allows clients to initialize in the correct sequence and
guarantees that we will have an email address to use in the JID.
*
* XMPP (Jabber) service for the Citadel system
* Copyright (c) 2007 by Art Cancro
*
* XMPP (Jabber) service for the Citadel system
* Copyright (c) 2007 by Art Cancro
/* The features of this stream are... */
cprintf("<stream:features>");
/* The features of this stream are... */
cprintf("<stream:features>");
- /* Binding... */
- cprintf("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>");
-
- /* Sessions... */
- cprintf("<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>");
-
- /* SASL (but only if we're not already logged in; this is important!) ... */
+ /* If we're not logged in yet, offer SASL as our feature set */
xmpp_output_auth_mechs();
}
xmpp_output_auth_mechs();
}
+ else {
+ /* If we've logged in, now offer binding and sessions as our feature set */
+ cprintf("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>");
+ cprintf("<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>");
+ }
- /* ...and the ability to close XML tags using angle brackets. We should patent this. */
cprintf("</stream:features>");
}
cprintf("</stream:features>");
}
/* Generate the "full JID" of the client resource */
/* Generate the "full JID" of the client resource */
+ // snprintf(XMPP->client_jid, sizeof XMPP->client_jid,
+ // "%d@%s/%s",
+ // CC->cs_pid,
+ // config.c_fqdn,
+ // XMPP->iq_client_resource
+ //);
+
snprintf(XMPP->client_jid, sizeof XMPP->client_jid,
snprintf(XMPP->client_jid, sizeof XMPP->client_jid,
- "%d@%s/%s",
- CC->cs_pid,
- config.c_fqdn,
+ "%s/%s",
+ CC->cs_inet_email,
XMPP->iq_client_resource
);
XMPP->iq_client_resource
);
}
/* return our Subversion id for the Log */
}
/* return our Subversion id for the Log */