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)
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))
/* Check dimmed rule */
account_name = modest_window_get_active_account (win);
- dimmed = modest_account_mgr_account_is_busy (mgr, account_name);
+
+ if (account_name)
+ dimmed = modest_account_mgr_account_is_busy (mgr, account_name);
+ else
+ dimmed = TRUE;
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mcen_nc_no_email_acnts_defined"));