From ac5771377ea95287a99bfd5c8c99ec65e9bb069d Mon Sep 17 00:00:00 2001 From: Arnav Singh Date: Thu, 27 Jun 2013 23:46:37 -0700 Subject: [PATCH] fe-gtk: Only escape notification bodies for notification servers that support "body-markup". --- src/fe-gtk/plugin-tray.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index d0196bcb..731d5857 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -180,13 +180,23 @@ fe_tray_set_balloon (const char *title, const char *text) return; #ifdef USE_LIBNOTIFY + static int notify_text_strip_flags = STRIP_ALL; NotifyNotification *notification; char *notify_text, *notify_title; if (!notify_is_initted()) + { notify_init(PACKAGE_NAME); - notify_text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP); + GList* server_caps = notify_get_server_caps (); + if (g_list_find_custom (server_caps, "body-markup", (GCompareFunc)strcmp)) + { + notify_text_strip_flags |= STRIP_ESCMARKUP; + } + g_list_free_full (server_caps, g_free); + } + + notify_text = strip_color (text, -1, notify_text_strip_flags); notify_title = strip_color (title, -1, STRIP_ALL); notification = XC_NOTIFY_NEW (notify_title, notify_text, HEXCHATSHAREDIR "/icons/hicolor/scalable/apps/hexchat.svg", NULL);