Removed ical_dezonify() from the citserver build ... it isn't used anymore
[citadel.git] / citadel / modules / xmpp / serv_xmpp.c
index 2ee2493cc1fe8b6e48fbbbe53e4ef64826be5228..34c6e5d2e7c767a0c3f5cc490cd842ef13609b0b 100644 (file)
@@ -57,6 +57,9 @@
 #include "ctdl_module.h"
 #include "serv_xmpp.h"
 
+/* uncomment for more verbosity - it will log all received XML tags */
+#define XMPP_XML_DEBUG
+
 /* XML_StopParser is present in expat 2.x */
 #if XML_MAJOR_VERSION > 1
 #define HAVE_XML_STOPPARSER
@@ -64,7 +67,6 @@
 
 struct xmpp_event *xmpp_queue = NULL;
 
-int XMPPSrvDebugEnable = 0;
 
 
 
@@ -239,12 +241,12 @@ void xmpp_xml_start(void *data, const char *supplied_el, const char **attr) {
                strcpy(el, ++sep);
        }
 
-       /*
+#ifdef XMPP_XML_DEBUG
        syslog(LOG_DEBUG, "xmpp: ELEMENT START: <%s>", el);
        for (i=0; attr[i] != NULL; i+=2) {
                syslog(LOG_DEBUG, "xmpp: Attribute '%s' = '%s'", attr[i], attr[i+1]);
        }
-       uncomment for more verbosity */
+#endif
 
        if (!strcasecmp(el, "stream")) {
                xmpp_stream_start(data, supplied_el, attr);
@@ -311,12 +313,12 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
                strcpy(el, ++sep);
        }
 
-       /*
+#ifdef XMPP_XML_DEBUG
        syslog(LOG_DEBUG, "xmpp: ELEMENT END  : <%s>", el);
        if (XMPP->chardata_len > 0) {
                syslog(LOG_DEBUG, "xmpp: chardata: %s", XMPP->chardata);
        }
-       uncomment for more verbosity */
+#endif
 
        if (!strcasecmp(el, "resource")) {
                if (XMPP->chardata_len > 0) {
@@ -435,8 +437,9 @@ void xmpp_xml_end(void *data, const char *supplied_el) {
 
                else {
                        cprintf("<iq type=\"error\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));
-                       cprintf("<error>Don't know howto do '%s'!</error>", xmlesc(xmlbuf, XMPP->iq_type, sizeof xmlbuf));
+                       cprintf("<error>Don't know how to do '%s'!</error>", xmlesc(xmlbuf, XMPP->iq_type, sizeof xmlbuf));
                        cprintf("</iq>");
+                       syslog(LOG_DEBUG, "XMPP: don't know how to do iq_type='%s' with iq_query_xmlns='%s'", XMPP->iq_type, XMPP->iq_query_xmlns);
                }
 
                /* Now clear these fields out so they don't get used by a future stanza */
@@ -656,10 +659,6 @@ void xmpp_logout_hook(void) {
 }
 
 
-void LogXMPPSrvDebugEnable(const int n)
-{
-       XMPPSrvDebugEnable = n;
-}
 const char *CitadelServiceXMPP="XMPP";
 extern void xmpp_cleanup_events(void);
 CTDL_MODULE_INIT(xmpp)
@@ -672,7 +671,6 @@ CTDL_MODULE_INIT(xmpp)
                                        xmpp_async_loop,
                                        CitadelServiceXMPP
                );
-               CtdlRegisterDebugFlagHook(HKEY("serv_xmpp"), LogXMPPSrvDebugEnable, &XMPPSrvDebugEnable);
                CtdlRegisterSessionHook(xmpp_cleanup_function, EVT_STOP, PRIO_STOP + 70);
                 CtdlRegisterSessionHook(xmpp_login_hook, EVT_LOGIN, PRIO_LOGIN + 90);
                 CtdlRegisterSessionHook(xmpp_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 90);