/*
* XMPP (Jabber) service for the Citadel system
- * Copyright (c) 2007-2015 by Art Cancro and citadel.org
+ * Copyright (c) 2007-2017 by Art Cancro and citadel.org
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
const XML_Char *systemId, const XML_Char *publicId,
const XML_Char *notationName
) {
- XMPPM_syslog(LOG_WARNING, "Illegal entity declaration encountered; stopping parser.");
+ syslog(LOG_WARNING, "xmpp: illegal entity declaration encountered; stopping parser.");
XML_StopParser(XMPP->xp, XML_FALSE);
}
#endif
}
/*
- XMPP_syslog(LOG_DEBUG, "XMPP ELEMENT START: <%s>\n", el);
+ syslog(LOG_DEBUG, "xmpp: ELEMENT START: <%s>", el);
for (i=0; attr[i] != NULL; i+=2) {
- XMPP_syslog(LOG_DEBUG, " Attribute '%s' = '%s'\n", attr[i], attr[i+1]);
+ syslog(LOG_DEBUG, "xmpp: Attribute '%s' = '%s'", attr[i], attr[i+1]);
}
uncomment for more verbosity */
}
/*
- XMPP_syslog(LOG_DEBUG, "XMPP ELEMENT END : <%s>\n", el);
+ syslog(LOG_DEBUG, "xmpp: ELEMENT END : <%s>", el);
if (XMPP->chardata_len > 0) {
- XMPP_syslog(LOG_DEBUG, " chardata: %s\n", XMPP->chardata);
+ syslog(LOG_DEBUG, "xmpp: chardata: %s", XMPP->chardata);
}
uncomment for more verbosity */
* Unknown query ... return the XML equivalent of a blank stare
*/
else {
- XMPP_syslog(LOG_DEBUG,
- "Unknown query <%s> - returning <service-unavailable/>\n",
- el
- );
+ syslog(LOG_DEBUG, "xmpp: Unknown query <%s> - returning <service-unavailable/>", el);
cprintf("<iq type=\"error\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));
cprintf("<error code=\"503\" type=\"cancel\">"
"<service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"
}
else if (!strcasecmp(el, "stream")) {
- XMPPM_syslog(LOG_DEBUG, "XMPP client shut down their stream\n");
+ syslog(LOG_DEBUG, "xmpp: client shut down their stream");
xmpp_massacre_roster();
cprintf("</stream>\n");
CC->kill_me = KILLME_CLIENT_LOGGED_OUT;
}
else {
- XMPP_syslog(LOG_DEBUG, "Ignoring unknown tag <%s>\n", el);
+ syslog(LOG_DEBUG, "xmpp: ignoring unknown tag <%s>", el);
}
XMPP->chardata_len = 0;
XMPP->xp = XML_ParserCreateNS("UTF-8", ':');
if (XMPP->xp == NULL) {
- XMPPM_syslog(LOG_ALERT, "Cannot create XML parser!\n");
+ syslog(LOG_ERR, "xmpp: cannot create XML parser");
CC->kill_me = KILLME_XML_PARSER;
return;
}
XML_Parse(XMPP->xp, ChrPtr(stream_input), rc, 0);
}
else {
- XMPPM_syslog(LOG_ERR, "client disconnected: ending session.\n");
+ syslog(LOG_ERR, "xmpp: client disconnected: ending session.");
CC->kill_me = KILLME_CLIENT_DISCONNECTED;
}
FreeStrBuf(&stream_input);
/*
- * Copyright (c) 2007-2009 by the citadel.org team
+ * Copyright (c) 2007-2017 by the citadel.org team
*
* 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.
void xmpp_delete_old_buddies_who_no_longer_exist_from_the_client_roster(void);
int xmpp_is_visible(struct CitContext *from, struct CitContext *to_whom);
char *xmlesc(char *buf, char *str, int bufsiz);
-
-extern int XMPPSrvDebugEnable;
-
-#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (XMPPSrvDebugEnable != 0))
-
-#define XMPP_syslog(LEVEL, FORMAT, ...) \
- DBGLOG(LEVEL) syslog(LEVEL, \
- "XMPP: " FORMAT, __VA_ARGS__)
-
-#define XMPPM_syslog(LEVEL, FORMAT) \
- DBGLOG(LEVEL) syslog(LEVEL, \
- "XMPP: " FORMAT);
/*
* Handle XMPP presence exchanges
*
- * Copyright (c) 2007-2015 by Art Cancro and citadel.org
+ * Copyright (c) 2007-2017 by Art Cancro and citadel.org
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
{
char xmlbuf[256];
- XMPP_syslog(LOG_DEBUG, "XMPP: indicating presence of <%s> to <%s>", presence_jid, XMPP->client_jid);
+ syslog(LOG_DEBUG, "xmpp: indicating presence of <%s> to <%s>", presence_jid, XMPP->client_jid);
cprintf("<presence from=\"%s\" ", xmlesc(xmlbuf, presence_jid, sizeof xmlbuf));
cprintf("to=\"%s\"></presence>", xmlesc(xmlbuf, XMPP->client_jid, sizeof xmlbuf));
}
}
}
- XMPP_syslog(LOG_DEBUG, "%d sessions for <%s> are now visible to session %d\n", visible_sessions, presence_jid, CC->cs_pid);
+ syslog(LOG_DEBUG, "xmpp: %d sessions for <%s> are now visible to session %d", visible_sessions, presence_jid, CC->cs_pid);
if ( (event_type == XMPP_EVT_LOGIN) && (visible_sessions == 1) ) {
- XMPP_syslog(LOG_DEBUG, "Telling session %d that <%s> logged in\n", CC->cs_pid, presence_jid);
+ syslog(LOG_DEBUG, "xmpp: telling session %d that <%s> logged in", CC->cs_pid, presence_jid);
/* Do an unsolicited roster update that adds a new contact. */
assert(which_cptr_is_relevant >= 0);
}
if (visible_sessions == 0) {
- XMPP_syslog(LOG_DEBUG, "Telling session %d that <%s> logged out\n",
- CC->cs_pid, presence_jid);
+ syslog(LOG_DEBUG, "xmpp: telling session %d that <%s> logged out", CC->cs_pid, presence_jid);
xmpp_destroy_buddy(presence_jid, 0); /* non aggressive presence update */
}
HashList *xmpp_fetch_mortuary(void) {
HashList *mortuary = NewHash(1, NULL);
if (!mortuary) {
- XMPPM_syslog(LOG_ALERT, "NewHash() failed!\n");
+ syslog(LOG_ALERT, "xmpp: NewHash() failed!");
return(NULL);
}
struct CitContext *cptr;
int nContexts, i;
- XMPPM_syslog(LOG_DEBUG, "Roster push!");
+ syslog(LOG_DEBUG, "xmpp: roster push!");
cprintf("<query xmlns=\"jabber:iq:roster\">");
cptr = CtdlGetContextArray(&nContexts);
if (cptr) {
for (i=0; i<nContexts; i++) {
if (xmpp_is_visible(&cptr[i], CC)) {
- XMPP_syslog(LOG_DEBUG, "Rosterizing %s\n", cptr[i].user.fullname);
+ syslog(LOG_DEBUG, "xmpp: rosterizing %s", cptr[i].user.fullname);
xmpp_roster_item(&cptr[i]);
}
}
/*
* Client is doing a namespace query. These are all handled differently.
- * A "rumplestiltskin lookup" is the most efficient way to handle this. Please do not refactor this code.
*/
void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_xmlns)
{
supported_namespace = 1;
}
- XMPP_syslog(LOG_DEBUG, "xmpp_query_namespace(id=%s, from=%s, to=%s, xmlns=%s)\n", iq_id, iq_from, iq_to, query_xmlns);
+ syslog(LOG_DEBUG, "xmpp: xmpp_query_namespace(id=%s, from=%s, to=%s, xmlns=%s)", iq_id, iq_from, iq_to, query_xmlns);
/*
* Beginning of query result.
*/
else {
- XMPP_syslog(LOG_DEBUG, "Unknown query namespace '%s' - returning <service-unavailable/>\n", query_xmlns);
+ syslog(LOG_DEBUG, "xmpp: unknown query namespace '%s' - returning <service-unavailable/>", query_xmlns);
cprintf("<error code=\"503\" type=\"cancel\">"
"<service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"
"</error>"
/*
* XMPP event queue
*
- * Copyright (c) 2007-2009 by Art Cancro
+ * Copyright (c) 2007-2017 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 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 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.
*/
#include "sysdep.h"
int purged_something = 0;
struct CitContext *cptr;
- MARK_syslog(LOG_DEBUG, "xmpp_queue_event(%d, %s)\n", event_type, email_addr);
+ syslog(LOG_DEBUG, "xmpp: xmpp_queue_event(%d, %s)", event_type, email_addr);
/* Purge events more than a minute old */
begin_critical_section(S_XMPP_QUEUE);
*
* 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 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 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.
*/
#include "sysdep.h"