#include <limits.h>
#include <ctype.h>
#include <libcitadel.h>
+#include <expat.h>
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#include "internet_addressing.h"
#include "md5.h"
#include "ctdl_module.h"
-
-#ifdef HAVE_EXPAT
-#include <expat.h>
#include "serv_xmpp.h"
struct xmpp_event *xmpp_queue = NULL;
void xmpp_stream_start(void *data, const char *supplied_el, const char **attr)
{
- lprintf(CTDL_DEBUG, "New XMPP stream.\n");
+ CtdlLogPrintf(CTDL_DEBUG, "New XMPP stream.\n");
while (*attr) {
if (!strcasecmp(attr[0], "to")) {
strcpy(el, ++sep);
}
- lprintf(CTDL_DEBUG, "XMPP ELEMENT START: <%s>\n", el);
+ CtdlLogPrintf(CTDL_DEBUG, "XMPP ELEMENT START: <%s>\n", el);
for (i=0; attr[i] != NULL; i+=2) {
- lprintf(CTDL_DEBUG, " Attribute '%s' = '%s'\n", attr[i], attr[i+1]);
+ CtdlLogPrintf(CTDL_DEBUG, " Attribute '%s' = '%s'\n", attr[i], attr[i+1]);
}
if (!strcasecmp(el, "stream")) {
strcpy(el, ++sep);
}
- lprintf(CTDL_DEBUG, "XMPP ELEMENT END : <%s>\n", el);
+ CtdlLogPrintf(CTDL_DEBUG, "XMPP ELEMENT END : <%s>\n", el);
if (XMPP->chardata_len > 0) {
- lprintf(CTDL_DEBUG, " chardata: %s\n", XMPP->chardata);
+ CtdlLogPrintf(CTDL_DEBUG, " chardata: %s\n", XMPP->chardata);
}
if (!strcasecmp(el, "resource")) {
/* Don't do this stuff if this is not a XMPP session! */
if (CC->h_command_function != xmpp_command_loop) return;
- lprintf(CTDL_DEBUG, "Performing XMPP cleanup hook\n");
+ CtdlLogPrintf(CTDL_DEBUG, "Performing XMPP cleanup hook\n");
if (XMPP->chardata != NULL) {
free(XMPP->chardata);
XMPP->chardata = NULL;
XMPP->xp = XML_ParserCreateNS("UTF-8", ':');
if (XMPP->xp == NULL) {
- lprintf(CTDL_ALERT, "Cannot create XML parser!\n");
+ CtdlLogPrintf(CTDL_ALERT, "Cannot create XML parser!\n");
CC->kill_me = 1;
return;
}
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
retval = client_read(cmdbuf, 1);
if (retval != 1) {
- lprintf(CTDL_ERR, "Client disconnected: ending session.\r\n");
+ CtdlLogPrintf(CTDL_ERR, "Client disconnected: ending session.\r\n");
CC->kill_me = 1;
return;
}
const char *CitadelServiceXMPP="XMPP";
-#endif /* HAVE_EXPAT */
-
CTDL_MODULE_INIT(jabber)
{
if (!threading) {
-#ifdef HAVE_EXPAT
CtdlRegisterServiceHook(config.c_xmpp_c2s_port,
NULL,
xmpp_greeting,
CtdlRegisterSessionHook(xmpp_logout_hook, EVT_LOGOUT);
CtdlRegisterSessionHook(xmpp_login_hook, EVT_UNSTEALTH);
CtdlRegisterSessionHook(xmpp_logout_hook, EVT_STEALTH);
- #else
- lprintf(CTDL_INFO, "This server is missing the Expat XML parser. Jabber service will be disabled.\n");
-#endif
}
/* return our Subversion id for the Log */