From c0ffb83fb803dd5375000f20106efe30baa4b135 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 18 Feb 2015 17:17:11 -0600 Subject: Make a version of the remove that doesn't escape --- src/im-application-list.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/im-application-list.c b/src/im-application-list.c index cbabc64..08c9730 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -395,13 +395,9 @@ im_application_list_source_activated (GSimpleAction *action, } static void -im_application_list_message_removed (Application *app, - const gchar *id) +im_application_list_message_removed_action (Application *app, + const gchar *action_name) { - gchar *action_name; - - action_name = escape_action_name (id); - g_action_map_remove_action (G_ACTION_MAP(app->message_actions), action_name); g_action_muxer_remove (app->message_sub_actions, action_name); @@ -409,6 +405,17 @@ im_application_list_message_removed (Application *app, im_application_list_update_root_action (app->list); g_signal_emit (app->list, signals[MESSAGE_REMOVED], 0, app->id, action_name); +} + +static void +im_application_list_message_removed (Application *app, + const gchar *id) +{ + gchar *action_name; + + action_name = escape_action_name (id); + + im_application_list_message_removed_action(app, action_name); g_free (action_name); } @@ -442,7 +449,7 @@ im_application_list_message_activated (GSimpleAction *action, app->cancellable, NULL, NULL); } - im_application_list_message_removed (app, action_name); + im_application_list_message_removed_action (app, action_name); g_free (message_id); } @@ -502,7 +509,7 @@ im_application_list_remove_all (GSimpleAction *action, message_actions = g_action_group_list_actions (G_ACTION_GROUP (app->message_actions)); for (it = message_actions; *it; it++) - im_application_list_message_removed (app, *it); + im_application_list_message_removed_action (app, *it); if (app->proxy != NULL) /* If it is remote, we tell the app we've cleared */ { -- cgit v1.2.3 From 0f90f415b9b860a2013ba8bfb306977c2b0fea28 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 18 Feb 2015 17:20:15 -0600 Subject: Adding a version of source_removed that doesn't unescape --- src/im-application-list.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/im-application-list.c b/src/im-application-list.c index 08c9730..2d0d7fd 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -343,6 +343,17 @@ application_update_draws_attention (Application * app) return was_drawing_attention != app->draws_attention; } +static void +im_application_list_source_removed_action (Application *app, + const gchar *action_name) +{ + g_action_map_remove_action (G_ACTION_MAP(app->source_actions), action_name); + g_signal_emit (app->list, signals[SOURCE_REMOVED], 0, app->id, action_name); + + if (application_update_draws_attention(app)) + im_application_list_update_root_action (app->list); +} + /* Remove a source from an application, signal up and update the status of the draws attention flag. */ static void @@ -353,11 +364,7 @@ im_application_list_source_removed (Application *app, action_name = escape_action_name (id); - g_action_map_remove_action (G_ACTION_MAP(app->source_actions), action_name); - g_signal_emit (app->list, signals[SOURCE_REMOVED], 0, app->id, action_name); - - if (application_update_draws_attention(app)) - im_application_list_update_root_action (app->list); + im_application_list_source_removed_action (app, action_name); g_free (action_name); } @@ -389,7 +396,7 @@ im_application_list_source_activated (GSimpleAction *action, app->cancellable, NULL, NULL); } - im_application_list_source_removed (app, action_name); + im_application_list_source_removed_action (app, action_name); g_free (source_id); } @@ -505,7 +512,7 @@ im_application_list_remove_all (GSimpleAction *action, source_actions = g_action_group_list_actions (G_ACTION_GROUP (app->source_actions)); for (it = source_actions; *it; it++) - im_application_list_source_removed (app, *it); + im_application_list_source_removed_action (app, *it); message_actions = g_action_group_list_actions (G_ACTION_GROUP (app->message_actions)); for (it = message_actions; *it; it++) -- cgit v1.2.3 From 261ef70765e5ba220911cad762bd91b08a5ebe44 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 18 Feb 2015 21:12:06 -0600 Subject: Adding a manual test case for a Tweet --- tests/manual | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/manual b/tests/manual index 412a97a..d638875 100644 --- a/tests/manual +++ b/tests/manual @@ -61,3 +61,20 @@ Test-case indicator-messages/unity8-embedded-greeter
Clear the message in the greeter
The message should no longer be in the messaging menu
+ +Test-case indicator-messages/push-message-twitter +
+
From a shell prompt send a simultated Twitter push notification
+
gdbus call --session --dest com.ubuntu.Postal --object-path /com/ubuntu/Postal/com_2eubuntu_2edeveloper_2ewebapps_2ewebapp_2dtwitter --method com.ubuntu.Postal.Post com.ubuntu.developer.webapps.webapp-twitter_webapp-twitter '"{\"message\": \"foobar\", \"notification\":{\"card\": {\"summary\": \"yes\", \"body\": \"hello\", \"popup\": true, \"persist\": true}}}"'
+
The messaging envelope on the panel should change to highlight a message
+
Open the messaging menu
+
The menu should contain an entry with the Twitter icon for the application
+
The title of the message should be 'yes'
+
The body of the message should be 'hello'
+
At the bottom of them menu there should be a 'Clear All' menu item
+
Clear the message using the 'Clear All' command
+
The Twitter message should disappear
+
The 'Clear All' item should disappear
+
The icon in the panel should return to its original state
+
+ -- cgit v1.2.3