From 1701ee6fbba2fe55811f974036512445387b2730 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Wed, 4 May 2011 11:37:19 +0300 Subject: [PATCH] groupchat: fix broken XML generated for line breaks Pidgin sends us line breaks encoded as
which is incorrect XML. Replace them with
. --- src/core/sipe-groupchat.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/sipe-groupchat.c b/src/core/sipe-groupchat.c index f79550c3..4da9233c 100644 --- a/src/core/sipe-groupchat.c +++ b/src/core/sipe-groupchat.c @@ -945,7 +945,7 @@ void sipe_groupchat_send(struct sipe_core_private *sipe_private, const gchar *what) { struct sipe_groupchat *groupchat = sipe_private->groupchat; - gchar *cmd, *self, *timestamp; + gchar *cmd, *self, *timestamp, *tmp; struct sipe_groupchat_msg *msg; if (!groupchat || !chat_session) @@ -966,11 +966,16 @@ void sipe_groupchat_send(struct sipe_core_private *sipe_private, * & -> & * * No need to escape them here. + * + * Only exception are line breaks which are encoded as
. + * Replace them with the correct XML tag
. */ + tmp = replace(what, "
", "
"); cmd = g_strdup_printf("" "%s" "", - chat_session->id, self, timestamp, what); + chat_session->id, self, timestamp, tmp); + g_free(tmp); g_free(timestamp); g_free(self); msg = chatserver_command(sipe_private, cmd); -- 2.11.4.GIT