Do not show "mark as (un)read" for messages sent as attachments
[modest] / src / modest-ui-dimming-rules.c
index 2857cf7..1738cad 100644 (file)
@@ -912,17 +912,21 @@ modest_ui_dimming_rules_on_mark_as_read_msg_in_view (ModestWindow *win, gpointer
        TnyHeader *header;
        TnyHeaderFlags flags;
        gboolean dimmed = FALSE;
-       
+
 
        g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW(win), FALSE);
        g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
        rule = MODEST_DIMMING_RULE (user_data);
-       
+
        header = modest_msg_view_window_get_header (MODEST_MSG_VIEW_WINDOW (win));
        if (!header) {
                dimmed = TRUE;
        }
 
+       /* If the viewer is showing a message sent as attachment */
+       if (!dimmed)
+               dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW (win));
+
        if (!dimmed) {
                flags = tny_header_get_flags (header);
                if (flags & TNY_HEADER_FLAG_SEEN)
@@ -953,6 +957,10 @@ modest_ui_dimming_rules_on_mark_as_unread_msg_in_view (ModestWindow *win, gpoint
                dimmed = TRUE;
        }
 
+       /* If the viewer is showing a message sent as attachment */
+       if (!dimmed)
+               dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW (win));
+
        if (!dimmed) {
                flags = tny_header_get_flags (header);
                if (!(flags & TNY_HEADER_FLAG_SEEN))
@@ -2903,12 +2911,12 @@ _msgs_send_in_progress (void)
        cache_mgr = modest_runtime_get_cache_mgr ();
        send_queue_cache = modest_cache_mgr_get_cache (cache_mgr,
                                                       MODEST_CACHE_MGR_CACHE_TYPE_SEND_QUEUE);
-       
+
        g_hash_table_foreach (send_queue_cache, (GHFunc) fill_list_of_caches, &send_queues);
-               
+
        for (node = send_queues; node != NULL && !found; node = g_slist_next (node)) {
                send_queue = MODEST_TNY_SEND_QUEUE (node->data);
-               
+
                /* Check if msg uid is being processed inside send queue */
                if (modest_tny_send_queue_sending_in_progress (send_queue)) {
                        found = TRUE;