aboutsummaryrefslogtreecommitdiff
path: root/src/im-phone-menu.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-11-28 17:39:14 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-11-28 17:39:14 +0100
commite6930c0df67ab53fcb2f7183741dee1bc0d599d4 (patch)
treedf52c4e4a9159231bd68fd986875c533395b4978 /src/im-phone-menu.c
parent235a7edc5c2fc2435c837f8a3d427dd0755f966d (diff)
downloadayatana-indicator-messages-e6930c0df67ab53fcb2f7183741dee1bc0d599d4.tar.gz
ayatana-indicator-messages-e6930c0df67ab53fcb2f7183741dee1bc0d599d4.tar.bz2
ayatana-indicator-messages-e6930c0df67ab53fcb2f7183741dee1bc0d599d4.zip
Expose message actions in the phone menu
And use com.canonical.indicator.messages.snapdecision as widget type if the message has actions.
Diffstat (limited to 'src/im-phone-menu.c')
-rw-r--r--src/im-phone-menu.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/im-phone-menu.c b/src/im-phone-menu.c
index 728c08b..6e511ac 100644
--- a/src/im-phone-menu.c
+++ b/src/im-phone-menu.c
@@ -151,6 +151,7 @@ im_phone_menu_add_message (ImPhoneMenu *menu,
const gchar *title,
const gchar *subtitle,
const gchar *body,
+ GVariant *actions,
gint64 time)
{
GMenuItem *item;
@@ -162,7 +163,15 @@ im_phone_menu_add_message (ImPhoneMenu *menu,
action_name = g_strconcat (app_id, ".msg.", id, NULL);
item = g_menu_item_new (title, action_name);
- g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.indicator.messages.messageitem");
+
+ if (g_variant_n_children (actions))
+ {
+ g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.indicator.messages.snapdecision");
+ g_menu_item_set_attribute (item, "x-canonical-message-actions", "v", actions);
+ }
+ else
+ g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.indicator.messages.messageitem");
+
g_menu_item_set_attribute (item, "x-canonical-message-id", "s", id);
g_menu_item_set_attribute (item, "x-canonical-subtitle", "s", subtitle);
g_menu_item_set_attribute (item, "x-canonical-text", "s", body);