aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:08:11 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:08:11 +0800
commit7730ffdcd842e21ea10002dba6855285128e6d5c (patch)
tree629438dcf340dcecd0ab8ca4ff4ce61ddc38522d
parent991e8bfd4396da222723a7a1712d37aab75111aa (diff)
downloadgsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.tar
gsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.tar.gz
gsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.tar.bz2
gsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.tar.lz
gsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.tar.xz
gsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.tar.zst
gsoc2013-empathy-7730ffdcd842e21ea10002dba6855285128e6d5c.zip
Escape message body with g_markup_escape_text before pushing it to the notification.
svn path=/trunk/; revision=2296
-rw-r--r--src/empathy-chat-window.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index b97482980..85504c0d7 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -865,7 +865,7 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
EmpathyChat *chat)
{
EmpathyContact *sender;
- char *header;
+ char *header, *escaped;
const char *body;
GdkPixbuf *pixbuf;
EmpathyChatWindowPriv *priv = GET_PRIV (window);
@@ -885,6 +885,7 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
header = g_strdup_printf (_("New message from %s"),
empathy_contact_get_name (sender));
body = empathy_message_get_body (message);
+ escaped = g_markup_escape_text (body, -1);
pixbuf = empathy_pixbuf_avatar_from_contact_scaled (sender, 48, 48);
if (pixbuf == NULL) {
pixbuf = empathy_pixbuf_from_icon_name_sized
@@ -893,10 +894,10 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
if (priv->notification != NULL) {
notify_notification_update (priv->notification,
- header, body, NULL);
+ header, escaped, NULL);
notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
} else {
- priv->notification = notify_notification_new (header, body, NULL, NULL);
+ priv->notification = notify_notification_new (header, escaped, NULL, NULL);
notify_notification_set_timeout (priv->notification, NOTIFY_EXPIRES_DEFAULT);
notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
@@ -908,6 +909,7 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
g_object_unref (pixbuf);
g_free (header);
+ g_free (escaped);
}
static void