fe-gtk: Only escape notification bodies for notification servers that support "body-markup".

This commit is contained in:
Arnav Singh 2013-06-27 23:46:37 -07:00
parent 863dc2e841
commit ac5771377e
1 changed files with 11 additions and 1 deletions

View File

@ -180,13 +180,23 @@ fe_tray_set_balloon (const char *title, const char *text)
return; return;
#ifdef USE_LIBNOTIFY #ifdef USE_LIBNOTIFY
static int notify_text_strip_flags = STRIP_ALL;
NotifyNotification *notification; NotifyNotification *notification;
char *notify_text, *notify_title; char *notify_text, *notify_title;
if (!notify_is_initted()) if (!notify_is_initted())
{
notify_init(PACKAGE_NAME); 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); notify_title = strip_color (title, -1, STRIP_ALL);
notification = XC_NOTIFY_NEW (notify_title, notify_text, HEXCHATSHAREDIR "/icons/hicolor/scalable/apps/hexchat.svg", NULL); notification = XC_NOTIFY_NEW (notify_title, notify_text, HEXCHATSHAREDIR "/icons/hicolor/scalable/apps/hexchat.svg", NULL);