aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-08-05 05:15:38 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2009-08-05 05:35:20 +0800
commit485ccb5ac65dc8beccd511c9575c3f58ae52d047 (patch)
tree090d79be15a85d236445b32e99c657918c56313c /src
parent8ef6b63b1ce2f906b9cfe74ad49e2981c435bd9c (diff)
downloadgsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.tar
gsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.tar.gz
gsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.tar.bz2
gsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.tar.lz
gsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.tar.xz
gsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.tar.zst
gsoc2013-empathy-485ccb5ac65dc8beccd511c9575c3f58ae52d047.zip
Escape markup in notifications and icon tooltip
7730ffd fixed this for the notifications that are produced by the chat window, but not for the ones produced by the status icon. Why these are separate code paths eludes me.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index f6c63c537..1f6a32c95 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -23,6 +23,8 @@
#include <string.h>
+#include <glib.h>
+
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@@ -136,16 +138,18 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
}
if (priv->event) {
+ gchar *message_esc = g_markup_escape_text (priv->event->message, -1);
+
pixbuf = empathy_misc_get_pixbuf_for_notification (priv->event->contact,
priv->event->icon_name);
if (priv->notification) {
notify_notification_update (priv->notification,
- priv->event->header, priv->event->message,
+ priv->event->header, message_esc,
NULL);
} else {
priv->notification = notify_notification_new_with_status_icon
- (priv->event->header, priv->event->message, NULL, priv->icon);
+ (priv->event->header, message_esc, NULL, priv->icon);
notify_notification_set_timeout (priv->notification,
NOTIFY_EXPIRES_DEFAULT);
@@ -160,6 +164,7 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
notify_notification_show (priv->notification, NULL);
g_object_unref (pixbuf);
+ g_free (message_esc);
} else {
notification_close_helper (priv);
}
@@ -173,12 +178,12 @@ status_icon_update_tooltip (EmpathyStatusIcon *icon)
if (priv->event) {
if (priv->event->message != NULL)
- tooltip = g_strdup_printf ("<i>%s</i>\n%s",
- priv->event->header,
- priv->event->message);
+ tooltip = g_markup_printf_escaped ("<i>%s</i>\n%s",
+ priv->event->header,
+ priv->event->message);
else
- tooltip = g_strdup_printf ("<i>%s</i>",
- priv->event->header);
+ tooltip = g_markup_printf_escaped ("<i>%s</i>",
+ priv->event->header);
gtk_status_icon_set_tooltip_markup (priv->icon, tooltip);
} else {
tooltip = g_strdup (empathy_idle_get_status (priv->idle));