aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-09-17 10:58:20 -0500
committerTed Gould <ted@gould.cx>2014-09-17 10:58:20 -0500
commit20dc96cc27115c6b20740ee1044baf4521bb11b7 (patch)
tree0ad39aaa6bb18d1acf50975c6086b726ed098b4e /src
parent3132098cf6e98cb6904d6e25df0267e5a524f22a (diff)
downloadayatana-indicator-messages-20dc96cc27115c6b20740ee1044baf4521bb11b7.tar.gz
ayatana-indicator-messages-20dc96cc27115c6b20740ee1044baf4521bb11b7.tar.bz2
ayatana-indicator-messages-20dc96cc27115c6b20740ee1044baf4521bb11b7.zip
Check show data to whether we should put in the body, subtitle and actions
Diffstat (limited to 'src')
-rw-r--r--src/im-phone-menu.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/im-phone-menu.c b/src/im-phone-menu.c
index 6e74954..58a23ff 100644
--- a/src/im-phone-menu.c
+++ b/src/im-phone-menu.c
@@ -180,10 +180,12 @@ im_phone_menu_add_message (ImPhoneMenu *menu,
gint n_messages;
gint pos;
GVariant *serialized_app_icon;
+ gboolean show_data;
g_return_if_fail (IM_IS_PHONE_MENU (menu));
g_return_if_fail (app_id);
+ show_data = im_menu_show_data(IM_MENU (menu));
action_name = g_strconcat (app_id, ".msg.", id, NULL);
item = g_menu_item_new (title, NULL);
@@ -191,8 +193,10 @@ im_phone_menu_add_message (ImPhoneMenu *menu,
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);
+ if (show_data)
+ g_menu_item_set_attribute (item, "x-canonical-subtitle", "s", subtitle);
+ if (show_data)
+ g_menu_item_set_attribute (item, "x-canonical-text", "s", body);
g_menu_item_set_attribute (item, "x-canonical-time", "x", time);
if (serialized_icon)
@@ -204,7 +208,7 @@ im_phone_menu_add_message (ImPhoneMenu *menu,
g_variant_unref (serialized_app_icon);
}
- if (actions)
+ if (actions && show_data)
g_menu_item_set_attribute (item, "x-canonical-message-actions", "v", actions);
n_messages = g_menu_model_get_n_items (G_MENU_MODEL (menu->message_section));