File 0011-fix-notify-osd.patch of Package pidgin-libnotify
diff -aur pidgin-libnotify-0.14/src/pidgin-libnotify.c pidgin-libnotify-0.14.new/src/pidgin-libnotify.c
--- pidgin-libnotify-0.14/src/pidgin-libnotify.c
+++ pidgin-libnotify-0.14.new/src/pidgin-libnotify.c
@@ -287,6 +287,32 @@
return purple_status_is_online (status) && purple_status_is_available (status);
}
+static gboolean
+notify_supports_actions ()
+{
+ GList *caps;
+ gint i = 0;
+
+ caps = notify_get_server_caps ();
+
+ do
+ {
+ if (g_strcmp0 (caps->data, "actions") == 0)
+ {
+ g_list_free (caps);
+ return TRUE;
+ }
+
+ if (caps->next != NULL)
+ caps = g_list_next (caps);
+
+ } while (caps->next != NULL);
+
+ g_list_free (caps);
+
+ return FALSE;
+}
+
static void
notify (const gchar *title,
const gchar *body,
@@ -389,7 +415,11 @@
notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
- notify_notification_add_action (notification, "show", _("Show"), action_cb, NULL, NULL);
+ /* Check if notification server can use actions */
+ if (notify_supports_actions ())
+ {
+ notify_notification_add_action (notification, "show", _("Show"), action_cb, NULL, NULL);
+ }
notify_notification_set_timeout(notification, purple_prefs_get_int("/plugins/gtk/libnotify/timeout"));
if (!notify_notification_show (notification, NULL)) {