aboutsummaryrefslogtreecommitdiff
path: root/src/notifications-service.c
diff options
context:
space:
mode:
authorJason Conti <jason.conti@gmail.com>2011-05-17 16:15:41 -0400
committerJason Conti <jason.conti@gmail.com>2011-05-17 16:15:41 -0400
commit425bde705a072effe6232cb3fa4fecdcb8849639 (patch)
tree453adb3ed0c348dba733b419ea8ec1131e1c6850 /src/notifications-service.c
parentc802236c56882bbfbb773801a7351a9e6cc11ba9 (diff)
downloadayatana-indicator-notifications-425bde705a072effe6232cb3fa4fecdcb8849639.tar.gz
ayatana-indicator-notifications-425bde705a072effe6232cb3fa4fecdcb8849639.tar.bz2
ayatana-indicator-notifications-425bde705a072effe6232cb3fa4fecdcb8849639.zip
Adding a timestamp to the messages. Currently sends a timestamp string across dbus, but ideally it will send an integer, and the indicator can decide how to display it (time ago in words, custom time format, etc).
Diffstat (limited to 'src/notifications-service.c')
-rw-r--r--src/notifications-service.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/notifications-service.c b/src/notifications-service.c
index 72f6dee..38fa247 100644
--- a/src/notifications-service.c
+++ b/src/notifications-service.c
@@ -75,11 +75,14 @@ add_notification_item(gpointer user_data)
dbusmenu_menuitem_child_delete(root, empty_item);
}
+ gchar *timestamp_string = notification_timestamp_for_locale(note);
+
item = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_TYPE, NOTIFICATION_MENUITEM_TYPE);
dbusmenu_menuitem_property_set(item, NOTIFICATION_MENUITEM_PROP_APP_NAME, notification_get_app_name(note));
dbusmenu_menuitem_property_set(item, NOTIFICATION_MENUITEM_PROP_SUMMARY, notification_get_summary(note));
dbusmenu_menuitem_property_set(item, NOTIFICATION_MENUITEM_PROP_BODY, notification_get_body(note));
+ dbusmenu_menuitem_property_set(item, NOTIFICATION_MENUITEM_PROP_TIMESTAMP_STRING, timestamp_string);
dbusmenu_menuitem_child_prepend(root, item);
g_queue_push_head(notification_items, item);
length++;
@@ -97,6 +100,7 @@ add_notification_item(gpointer user_data)
/* Notify the indicator that a new message has been added */
notifications_interface_message_added(dbus);
+ g_free(timestamp_string);
g_object_unref(note);
return FALSE;