From 54c6418d619e1ec96166f9fabb426f011068de99 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Sun, 10 Apr 2016 23:46:11 +0200 Subject: [PATCH] Support for older libnotify versions --- src/fe-gtk/notifications/notification-libnotify.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/fe-gtk/notifications/notification-libnotify.c b/src/fe-gtk/notifications/notification-libnotify.c index 94f9679d..91148377 100644 --- a/src/fe-gtk/notifications/notification-libnotify.c +++ b/src/fe-gtk/notifications/notification-libnotify.c @@ -20,6 +20,10 @@ #include #include +#ifndef NOTIFY_CHECK_VERSION +#define NOTIFY_CHECK_VERSION(x,y,z) 0 +#endif + static gboolean strip_markup = FALSE; void @@ -30,8 +34,16 @@ notification_backend_show (const char *title, const char *text) if (strip_markup) text = g_markup_escape_text (text, -1); +#if NOTIFY_CHECK_VERSION(0,7,0) notification = notify_notification_new (title, text, "hexchat"); +#else + notification = notify_notification_new (title, text, "hexchat", NULL); +#endif +#if NOTIFY_CHECK_VERSION(0,6,0) notify_notification_set_hint (notification, "desktop-entry", g_variant_new_string ("hexchat")); +#else + notify_notification_set_hint_string (notification, "desktop-entry", "hexchat"); +#endif notify_notification_show (notification, NULL); @@ -45,9 +57,6 @@ notification_backend_init (void) { GList* server_caps; - if (!NOTIFY_CHECK_VERSION (0, 7, 0)) - return 0; - if (!notify_init (PACKAGE_NAME)) return 0;