From 425bde705a072effe6232cb3fa4fecdcb8849639 Mon Sep 17 00:00:00 2001 From: Jason Conti Date: Tue, 17 May 2011 16:15:41 -0400 Subject: 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). --- src/notifications-service.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/notifications-service.c') 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; -- cgit v1.2.3