mail/view: respect per-folder/account pager filter override

pull/144/head
Manos Pitsidianakis 2021-09-13 13:21:09 +03:00
parent e7b9d2963c
commit a977351f0a
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 35 additions and 0 deletions

View File

@ -1345,12 +1345,26 @@ impl Component for MailView {
let colors = crate::conf::value(context, "mail.view.body"); let colors = crate::conf::value(context, "mail.view.body");
self.pager = self.pager =
Pager::from_string(text, Some(context), Some(0), None, colors); Pager::from_string(text, Some(context), Some(0), None, colors);
if let Some(ref filter) = mailbox_settings!(
context[self.coordinates.0][&self.coordinates.1]
.pager
.filter
) {
self.pager.filter(filter);
}
self.subview = None; self.subview = None;
} }
} else { } else {
text.push_str("Internal error. MailView::open_attachment failed."); text.push_str("Internal error. MailView::open_attachment failed.");
let colors = crate::conf::value(context, "mail.view.body"); let colors = crate::conf::value(context, "mail.view.body");
self.pager = Pager::from_string(text, Some(context), Some(0), None, colors); self.pager = Pager::from_string(text, Some(context), Some(0), None, colors);
if let Some(ref filter) = mailbox_settings!(
context[self.coordinates.0][&self.coordinates.1]
.pager
.filter
) {
self.pager.filter(filter);
}
self.subview = None; self.subview = None;
} }
} }
@ -1431,6 +1445,13 @@ impl Component for MailView {
}; };
let colors = crate::conf::value(context, "mail.view.body"); let colors = crate::conf::value(context, "mail.view.body");
self.pager = Pager::from_string(text, Some(context), None, None, colors); self.pager = Pager::from_string(text, Some(context), None, None, colors);
if let Some(ref filter) = mailbox_settings!(
context[self.coordinates.0][&self.coordinates.1]
.pager
.filter
) {
self.pager.filter(filter);
}
} }
/* /*
ViewMode::Ansi(ref buf) => { ViewMode::Ansi(ref buf) => {
@ -1482,6 +1503,13 @@ impl Component for MailView {
let colors = crate::conf::value(context, "mail.view.body"); let colors = crate::conf::value(context, "mail.view.body");
self.pager = self.pager =
Pager::from_string(text, Some(context), Some(cursor_pos), None, colors); Pager::from_string(text, Some(context), Some(cursor_pos), None, colors);
if let Some(ref filter) = mailbox_settings!(
context[self.coordinates.0][&self.coordinates.1]
.pager
.filter
) {
self.pager.filter(filter);
}
self.subview = None; self.subview = None;
} }
_ => { _ => {
@ -1498,6 +1526,13 @@ impl Component for MailView {
let colors = crate::conf::value(context, "mail.view.body"); let colors = crate::conf::value(context, "mail.view.body");
self.pager = self.pager =
Pager::from_string(text, Some(context), Some(cursor_pos), None, colors); Pager::from_string(text, Some(context), Some(cursor_pos), None, colors);
if let Some(ref filter) = mailbox_settings!(
context[self.coordinates.0][&self.coordinates.1]
.pager
.filter
) {
self.pager.filter(filter);
}
self.subview = None; self.subview = None;
} }
}; };