aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-notifications.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/indicator-notifications.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/indicator-notifications.c')
-rw-r--r--src/indicator-notifications.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/indicator-notifications.c b/src/indicator-notifications.c
index 9178958..72e806c 100644
--- a/src/indicator-notifications.c
+++ b/src/indicator-notifications.c
@@ -290,23 +290,22 @@ new_notification_menuitem(DbusmenuMenuitem *new_item, DbusmenuMenuitem *parent,
g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
g_return_val_if_fail(IS_INDICATOR_NOTIFICATIONS(user_data), FALSE);
- const gchar *app_name = dbusmenu_menuitem_property_get(new_item,
- NOTIFICATION_MENUITEM_PROP_APP_NAME);
- const gchar *summary = dbusmenu_menuitem_property_get(new_item,
- NOTIFICATION_MENUITEM_PROP_SUMMARY);
- const gchar *body = dbusmenu_menuitem_property_get(new_item,
- NOTIFICATION_MENUITEM_PROP_BODY);
-
- gchar *escaped_app_name = g_markup_escape_text(app_name, strlen(app_name));
- gchar *escaped_summary = g_markup_escape_text(summary, strlen(summary));
- gchar *escaped_body = g_markup_escape_text(body, strlen(body));
-
- gchar *markup = g_strdup_printf("<b>%s</b>\n%s\n<small><i>%s <b>%s</b></i></small>",
- escaped_summary, escaped_body, _("from"), escaped_app_name);
-
- g_free(escaped_app_name);
- g_free(escaped_summary);
- g_free(escaped_body);
+ gchar *app_name = g_markup_escape_text(dbusmenu_menuitem_property_get(new_item,
+ NOTIFICATION_MENUITEM_PROP_APP_NAME), -1);
+ gchar *summary = g_markup_escape_text(dbusmenu_menuitem_property_get(new_item,
+ NOTIFICATION_MENUITEM_PROP_SUMMARY), -1);
+ gchar *body = g_markup_escape_text(dbusmenu_menuitem_property_get(new_item,
+ NOTIFICATION_MENUITEM_PROP_BODY), -1);
+ gchar *timestamp_string = g_markup_escape_text(dbusmenu_menuitem_property_get(new_item,
+ NOTIFICATION_MENUITEM_PROP_TIMESTAMP_STRING), -1);
+
+ gchar *markup = g_strdup_printf("<b>%s</b>\n%s\n<small><i>%s %s <b>%s</b></i></small>",
+ summary, body, timestamp_string, _("from"), app_name);
+
+ g_free(app_name);
+ g_free(summary);
+ g_free(body);
+ g_free(timestamp_string);
GtkWidget *hbox = gtk_hbox_new(FALSE, 0);