X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_query_namespace.c;h=fb3374e9e73984a91d1584ab90007171305cd0ad;hp=cf6f423a56516cd392ce78ae9c79f93d486ff2f5;hb=73bcf6081a14008eb1020126273f133a324bb910;hpb=1c0b8162b0a90f2e97028a531005c11b09441498 diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index cf6f423a5..fb3374e9e 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -3,19 +3,13 @@ * * Copyright (c) 2007-2009 by Art Cancro * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "sysdep.h" @@ -71,6 +65,7 @@ void xmpp_roster_item(struct CitContext *cptr) { cprintf(""); } + /* * Return the results for a "jabber:iq:roster:query" * @@ -88,7 +83,7 @@ void xmpp_iq_roster_query(void) if (cptr) { for (i=0; i>>>>>> 1c0b8162b0a90f2e97028a531005c11b09441498 void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_xmlns) { int supported_namespace = 0; @@ -120,11 +115,17 @@ void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_x if ( (!strcasecmp(query_xmlns, "jabber:iq:roster:query")) || (!strcasecmp(query_xmlns, "jabber:iq:auth:query")) + || (!strcasecmp(query_xmlns, "http://jabber.org/protocol/disco#items:query")) + || (!strcasecmp(query_xmlns, "http://jabber.org/protocol/disco#info:query")) ) { supported_namespace = 1; } +<<<<<<< HEAD + syslog(LOG_DEBUG, "xmpp_query_namespace(id=%s, from=%s, to=%s, xmlns=%s)\n", iq_id, iq_from, iq_to, query_xmlns); +======= XMPP_syslog(LOG_DEBUG, "xmpp_query_namespace(%s, %s, %s, %s)\n", iq_id, iq_from, iq_to, query_xmlns); +>>>>>>> 1c0b8162b0a90f2e97028a531005c11b09441498 /* * Beginning of query result. @@ -134,10 +135,17 @@ void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_x } else { cprintf(">>>>>> 1c0b8162b0a90f2e97028a531005c11b09441498 cprintf("id=\"%s\">", xmlesc(xmlbuf, iq_id, sizeof xmlbuf)); /* @@ -156,16 +164,30 @@ void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_x ); } + // Extension "xep-0030" (http://xmpp.org/extensions/xep-0030.html) (return an empty set of results) + else if (!strcasecmp(query_xmlns, "http://jabber.org/protocol/disco#items:query")) { + cprintf("", xmlesc(xmlbuf, query_xmlns, sizeof xmlbuf)); + } + + // Extension "xep-0030" (http://xmpp.org/extensions/xep-0030.html) (return an empty set of results) + else if (!strcasecmp(query_xmlns, "http://jabber.org/protocol/disco#info:query")) { + cprintf("", xmlesc(xmlbuf, query_xmlns, sizeof xmlbuf)); + } + /* * If we didn't hit any known query namespaces then we should deliver a * "service unavailable" error (see RFC3921 section 2.4 and 11.1.5.4) */ else { +<<<<<<< HEAD + syslog(LOG_DEBUG, "Unknown query namespace '%s' - returning \n", query_xmlns); +======= XMPP_syslog(LOG_DEBUG, "Unknown query namespace '%s' - returning \n", query_xmlns ); +>>>>>>> 1c0b8162b0a90f2e97028a531005c11b09441498 cprintf("" "" ""