if (!strcasecmp(attr[i], "type")) iqtype = attr[i+1];
if (!strcasecmp(attr[i], "id")) iqid = attr[i+1];
}
+ if (iqtype != NULL) {
+ safestrncpy(XMPP->iq_type, iqtype, sizeof XMPP->iq_type);
+ }
if ((iqtype != NULL) && (iqid != NULL)) {
if (!strcasecmp(iqtype, "set")) {
safestrncpy(XMPP->iq_bind_id, iqid, sizeof XMPP->iq_bind_id);
else if (!strcasecmp(el, "iq")) {
+ /*
+ * iq type="get"
+ */
+ if (!strcasecmp(XMPP->iq_type, "get")) {
+ lprintf(CTDL_DEBUG, "\e[32m DISCO DUCK! \e[0m\n");
+ }
- /* If this <iq> stanza was a "bind" attempt, process it ... */
-
- if ( (!IsEmptyStr(XMPP->iq_bind_id)) && (!IsEmptyStr(XMPP->iq_client_resource)) ) {
+ /*
+ * If this <iq> stanza was a "bind" attempt, process it ...
+ */
+ else if ( (!IsEmptyStr(XMPP->iq_bind_id)) && (!IsEmptyStr(XMPP->iq_client_resource)) ) {
/* Generate the "full JID" of the client resource */
/* 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;
+ XMPP->iq_session = 0;
}
else if (!strcasecmp(el, "auth")) {
int chardata_alloc;
char client_jid[256]; /* "full JID" of the client */
+ char iq_type[256];
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 */
*/
void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) {
- if (strcasecmp(XMPP->sasl_auth_mech, "PLAIN")) {
+ if (strcasecmp(sasl_auth_mech, "PLAIN")) {
cprintf("<failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">");
cprintf("<invalid-mechanism/>");
cprintf("</failure>");