--- a/src/pidgin-libnotify.c +++ b/src/pidgin-libnotify.c @@ -254,6 +254,28 @@ should_notify_unavailable (PurpleAccount *account) return purple_status_is_online (status) && purple_status_is_available (status); } +static gboolean +notify_supports_actions () +{ + gboolean accepts_actions = FALSE; + GList *caps, *c; + + caps = notify_get_server_caps (); + + if (caps != NULL) { + for (c = caps; c != NULL; c = g_list_next (c)) { + if (g_strcmp0 (caps->data, "actions") == 0) { + accepts_actions = TRUE; + break; + } + } + g_list_foreach (caps, g_free, NULL); + g_list_free (caps); + } + + return accepts_actions; +} + static void notify (const gchar *title, const gchar *body, @@ -317,7 +339,10 @@ 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");