updated on Mon Jan 16 20:00:43 UTC 2012
[aur-mirror.git] / liferea-unity / notification-append
blob2d54dfafa887bb1c05b5462d150ad71c83f422ab
1 Index: liferea-1.6.4/src/notification/libnotify.c
2 ===================================================================
3 --- liferea-1.6.4.orig/src/notification/libnotify.c     2011-06-07 19:50:14.350498266 +0700
4 +++ liferea-1.6.4/src/notification/libnotify.c  2011-06-07 19:50:44.470498271 +0700
5 @@ -44,6 +44,7 @@
6  #include "notification/notification.h"
7  
8  static gboolean supports_actions = FALSE;
9 +static gboolean supports_append  = FALSE;
11  static void notif_libnotify_callback_open ( NotifyNotification *n, gchar *action, gpointer user_data ) {
12         g_assert(action != NULL);
13 @@ -150,7 +151,7 @@
14  //             notify_notification_update ( n, node_get_title(node_p), labelText_now_p, NULL);
15  //             notify_notification_clear_actions(n);
17 -               n = notify_notification_new (node_get_title(node_p), labelText_now_p, NULL, NULL);
18 +               n = notify_notification_new (node_get_title(node_p), labelText_now_p, NULL);
20                 notify_notification_set_icon_from_pixbuf (n,node_get_icon(node_p));
22 @@ -188,7 +189,11 @@
23                         for (c = caps; c != NULL; c = c->next) {
24                                 if (g_str_equal ((char*)c->data, "actions")) {
25                                         supports_actions = TRUE;
26 -                                       break;
27 +                                       continue;
28 +                               }
29 +                               if (g_str_equal ((char*)c->data, "append")) {
30 +                                       supports_append = TRUE;
31 +                                       continue;
32                                 }
33                         }
34                         g_list_foreach (caps, (GFunc)g_free, NULL);
35 @@ -242,12 +247,16 @@
36         if (item_count == 0)
37                 return;
39 -       labelSummary_p = g_strdup_printf (ngettext ("%s has %d new / updated headline\n", "%s has %d new / updated headlines\n", item_count), 
40 +       labelSummary_p = g_strdup_printf (ngettext ("<b>%s</b> has <b>%d</b> update", "<b>%s</b> has <b>%d</b> updates", item_count), 
41                                           node_get_title (node), item_count);
42 -       n = notify_notification_new ( _("Feed Update"), labelSummary_p, NULL, NULL);
43 +       n = notify_notification_new ( _("Feed Update"), labelSummary_p, "liferea");
44         g_free(labelSummary_p);
46 -       notify_notification_set_icon_from_pixbuf (n, node_get_icon (node));
47 +       if (supports_append) {
48 +               notify_notification_set_hint_string(n, "append", "allow");
49 +       } else {
50 +               notify_notification_set_icon_from_pixbuf (n, node_get_icon (node));
51 +       }
52         notify_notification_set_timeout (n, NOTIFY_EXPIRES_DEFAULT);
53         if (supports_actions) {
54                 notify_notification_add_action (n, "show_details", _("Show details"),