/*
* Handle messages sent and received using XMPP (Jabber) protocol
*
- * Copyright (c) 2007-2010 by Art Cancro
+ * Copyright (c) 2007-2014 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.
- *
- *
- *
- *
- *
*/
#include "sysdep.h"
CCC->FirstExpressMessage = CCC->FirstExpressMessage->next;
end_critical_section(S_SESSION_TABLE);
-
- XPUT("<message type=\"chat\" to=\"");
- XPutProp(Xmpp->client_jid, strlen(Xmpp->client_jid));
- XPUT("\" from=\"");
- XPutProp(ptr->sender_email, strlen(ptr->sender_email));
- XPUT("\" >");
+ XPrint(HKEY("message"), 0,
+ XCPROPERTY("type", "chat"),
+ XPROPERTY("to", Xmpp->client_jid, strlen(Xmpp->client_jid)),
+ XPROPERTY("from", ptr->sender_email, strlen(ptr->sender_email)),
+ TYPE_ARGEND);
if (ptr->text != NULL) {
striplt(ptr->text);
- XPUT("<body>");
- XPutBody(ptr->text, strlen(ptr->text));
- XPUT("</body>");
+ XPrint(HKEY("body"), XCLOSED,
+ XBODY(ptr->text, strlen(ptr->text)),
+ TYPE_ARGEND);
free(ptr->text);
}
XPUT("</message>");
XMPP->message_to[0] = 0;
time(&CCC->lastidle);
}
+
+
void xmpp_end_message(void *data, const char *supplied_el, const char **attr)
{
+ safestrncpy(XMPP->message_to, ChrPtr(XMPP->Message.to), sizeof(XMPP->message_to));
xmpp_send_message(XMPP->message_to, XMPP->message_body);
XMPP->html_tag_level = 0;
}