/*
* Handle messages sent and received using XMPP (Jabber) protocol
*
- * Copyright (c) 2007-2014 by Art Cancro
+ * Copyright (c) 2007-2010 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"
/*
* Client is sending a message.
*/
-void xmpp_send_message(char *message_to, char *message_body) {
+void xmpp_send_message(StrBuf *message_to, char *message_body) {
struct CitContext *CCC = CC;
char *recp = NULL;
struct CitContext *cptr;
if (message_body == NULL) return;
if (message_to == NULL) return;
- if (IsEmptyStr(message_to)) return;
+ if (StrLength(message_to) == 0) return;
if (!CCC->logged_in) return;
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if ( (cptr->logged_in)
&& (cptr->can_receive_im)
- && (!strcasecmp(cptr->cs_inet_email, message_to))
+ && (!strcasecmp(cptr->cs_inet_email, ChrPtr(message_to)))
) {
recp = cptr->user.fullname;
}
free(XMPP->message_body);
XMPP->message_body = NULL;
- 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_send_message(XMPP->Message.to, XMPP->message_body);
XMPP->html_tag_level = 0;
}