Do allow to remove messages when opened from notifications
authorSergio Villar Senín <svillar@igalia.com>
Tue, 12 Jan 2010 11:56:21 +0000 (12:56 +0100)
committerSergio Villar Senín <svillar@igalia.com>
Tue, 12 Jan 2010 13:16:45 +0000 (14:16 +0100)
Fixes NB#125155

Fixes https://bugs.maemo.org/show_bug.cgi?id=5417

src/modest-ui-dimming-rules.c

index 7f18fd0..6812635 100644 (file)
@@ -420,11 +420,14 @@ modest_ui_dimming_rules_on_delete_msg (ModestWindow *win, gpointer user_data)
                 * or when viewing a search result.
                 */
                if (!dimmed) {
-                       if (!modest_msg_view_window_is_search_result (MODEST_MSG_VIEW_WINDOW(win))) {
-                               dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW(win));
-                               if (dimmed) {
-                                       modest_dimming_rule_set_notification (rule, _CS_UNABLE_TO_DELETE);
-                               }
+                       TnyMsg *top_msg = NULL;
+                       top_msg = modest_msg_view_window_get_top_message ((ModestMsgViewWindow *) win);
+                       if (top_msg != NULL) {
+                               g_object_unref (top_msg);
+                               dimmed = TRUE;
+                       }
+                       if (dimmed) {
+                               modest_dimming_rule_set_notification (rule, _CS("ckct_ib_unable_to_delete"));
                        }
                }
        }