Handle ampersand

Replaced with & in messages
This commit is contained in:
James Booth
2012-04-19 22:26:12 +01:00
parent 9805b2b2b2
commit 366eecc195
7 changed files with 118 additions and 3 deletions

View File

@@ -27,6 +27,7 @@
#include "log.h"
#include "contact_list.h"
#include "windows.h"
#include "util.h"
#define PING_INTERVAL 120000 // 2 minutes
@@ -133,6 +134,8 @@ void jabber_process_events(void)
void jabber_send(const char * const msg, const char * const recipient)
{
char *coded_msg = str_replace(msg, "&", "&");
xmpp_stanza_t *reply, *body, *text;
reply = xmpp_stanza_new(jabber_conn.ctx);
@@ -144,7 +147,7 @@ void jabber_send(const char * const msg, const char * const recipient)
xmpp_stanza_set_name(body, "body");
text = xmpp_stanza_new(jabber_conn.ctx);
xmpp_stanza_set_text(text, msg);
xmpp_stanza_set_text(text, coded_msg);
xmpp_stanza_add_child(body, text);
xmpp_stanza_add_child(reply, body);