*** src/pidgin-libnotify.c 2008-12-14 10:45:51.000000000 -0700 --- src/pidgin-libnotify.c 2009-02-24 13:01:47.000000000 -0700 *************** *** 254,259 **** --- 254,285 ---- 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, *************** *** 316,323 **** g_signal_connect (notification, "closed", G_CALLBACK(closed_cb), NULL); notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); ! ! 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"); --- 342,353 ---- g_signal_connect (notification, "closed", G_CALLBACK(closed_cb), NULL); notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); ! ! /* 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"); *************** *** 329,335 **** notify_buddy_signon_cb (PurpleBuddy *buddy, gpointer data) { ! gchar *tr_name, *title; gboolean blocked; g_return_if_fail (buddy); --- 359,365 ---- notify_buddy_signon_cb (PurpleBuddy *buddy, gpointer data) { ! gchar *tr_name; gboolean blocked; g_return_if_fail (buddy); *************** *** 349,367 **** tr_name = truncate_escape_string (best_name (buddy), 25); ! title = g_strdup_printf (_("%s signed on"), tr_name); ! ! notify (title, NULL, buddy); g_free (tr_name); - g_free (title); } static void notify_buddy_signoff_cb (PurpleBuddy *buddy, gpointer data) { ! gchar *tr_name, *title; gboolean blocked; g_return_if_fail (buddy); --- 379,394 ---- tr_name = truncate_escape_string (best_name (buddy), 25); ! notify (tr_name, "Signed on", buddy); g_free (tr_name); } static void notify_buddy_signoff_cb (PurpleBuddy *buddy, gpointer data) { ! gchar *tr_name; gboolean blocked; g_return_if_fail (buddy); *************** *** 381,392 **** tr_name = truncate_escape_string (best_name (buddy), 25); ! title = g_strdup_printf (_("%s signed off"), tr_name); ! ! notify (title, NULL, buddy); g_free (tr_name); - g_free (title); } static void --- 408,416 ---- tr_name = truncate_escape_string (best_name (buddy), 25); ! notify (tr_name, "Signed off", buddy); g_free (tr_name); } static void