diff options
author | Arnav Singh <arnavion@gmail.com> | 2013-06-27 23:46:37 -0700 |
---|---|---|
committer | Arnav Singh <arnavion@gmail.com> | 2013-06-28 00:14:54 -0700 |
commit | ac5771377ea95287a99bfd5c8c99ec65e9bb069d (patch) | |
tree | dd3ee93981d7b5383a6beb8144f7089634e2a7ed /src/fe-gtk/plugin-tray.c | |
parent | 863dc2e8413c9c0fc6059fe5b16b2a269181e01e (diff) |
fe-gtk: Only escape notification bodies for notification servers that support "body-markup".
Diffstat (limited to 'src/fe-gtk/plugin-tray.c')
-rw-r--r-- | src/fe-gtk/plugin-tray.c | 12 |
1 files changed, 11 insertions, 1 deletions
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); |