summary refs log tree commit diff stats
path: root/src/fe-gtk
diff options
context:
space:
mode:
authorMarcel Telka <marcel@telka.sk>2016-04-10 23:46:11 +0200
committerPatrick Griffis <tingping@tingping.se>2016-04-10 21:22:12 -0400
commit54c6418d619e1ec96166f9fabb426f011068de99 (patch)
treec3501514101af7ae027942c9d244ceb7a7d4dade /src/fe-gtk
parentbd358dd5709a827eb3bf5d1534c8883038f9add9 (diff)
Support for older libnotify versions
Diffstat (limited to 'src/fe-gtk')
-rw-r--r--src/fe-gtk/notifications/notification-libnotify.c15
1 files 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 <glib.h>
 #include <libnotify/notify.h>
 
+#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;