* $Id$
*
* XMPP (Jabber) service for the Citadel system
- * Copyright (c) 2007 by Art Cancro
- * This code is released under the terms of the GNU General Public License.
+ * Copyright (c) 2007-2009 by Art Cancro
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
void xmpp_stream_start(void *data, const char *supplied_el, const char **attr)
{
- CtdlLogPrintf(CTDL_DEBUG, "New XMPP stream.\n");
-
while (*attr) {
if (!strcasecmp(attr[0], "to")) {
safestrncpy(XMPP->server_name, attr[1], sizeof XMPP->server_name);
strcpy(el, ++sep);
}
+ /*
CtdlLogPrintf(CTDL_DEBUG, "XMPP ELEMENT START: <%s>\n", el);
-
for (i=0; attr[i] != NULL; i+=2) {
CtdlLogPrintf(CTDL_DEBUG, " Attribute '%s' = '%s'\n", attr[i], attr[i+1]);
}
+ uncomment for more verbosity */
if (!strcasecmp(el, "stream")) {
xmpp_stream_start(data, supplied_el, attr);
strcpy(el, ++sep);
}
+ /*
CtdlLogPrintf(CTDL_DEBUG, "XMPP ELEMENT END : <%s>\n", el);
if (XMPP->chardata_len > 0) {
CtdlLogPrintf(CTDL_DEBUG, " chardata: %s\n", XMPP->chardata);
}
+ uncomment for more verbosity */
if (!strcasecmp(el, "resource")) {
if (XMPP->chardata_len > 0) {
/* Don't do this stuff if this is not a XMPP session! */
if (CC->h_command_function != xmpp_command_loop) return;
- CtdlLogPrintf(CTDL_DEBUG, "Performing XMPP cleanup hook\n");
if (XMPP->chardata != NULL) {
free(XMPP->chardata);
XMPP->chardata = NULL;
XML_SetElementHandler(XMPP->xp, xmpp_xml_start, xmpp_xml_end);
XML_SetCharacterDataHandler(XMPP->xp, xmpp_xml_chardata);
// XML_SetUserData(XMPP->xp, something...);
+
+ CC->can_receive_im = 1; /* This protocol is capable of receiving instant messages */
}