--- a/src/pidgin-libnotify.c +++ b/src/pidgin-libnotify.c @@ -254,6 +254,35 @@ should_notify_unavailable (PurpleAccount *account) 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 (); + + if (!caps) + return FALSE; + + 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, @@ -317,7 +346,11 @@ notify (const gchar *title, 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); + } if (!notify_notification_show (notification, NULL)) { purple_debug_error (PLUGIN_ID, "notify(), failed to send notification\n");