summaryrefslogtreecommitdiffstats
path: root/ui/src/components/mail
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/mail')
-rw-r--r--ui/src/components/mail/accounts.rs2
-rw-r--r--ui/src/components/mail/compose.rs2
-rw-r--r--ui/src/components/mail/view.rs15
-rw-r--r--ui/src/components/mail/view/envelope.rs8
4 files changed, 18 insertions, 9 deletions
diff --git a/ui/src/components/mail/accounts.rs b/ui/src/components/mail/accounts.rs
index ded7b002..cde1b375 100644
--- a/ui/src/components/mail/accounts.rs
+++ b/ui/src/components/mail/accounts.rs
@@ -65,7 +65,7 @@ impl Component for AccountsPanel {
UIEvent::Input(Key::Char('\n')) => {
context
.replies
- .push_back(UIEvent::Action(Tab(TabOpen(Some(Box::new(
+ .push_back(UIEvent::Action(Tab(New(Some(Box::new(
ContactList::for_account(self.cursor),
))))));
return true;
diff --git a/ui/src/components/mail/compose.rs b/ui/src/components/mail/compose.rs
index 4e76b61e..006c6dcf 100644
--- a/ui/src/components/mail/compose.rs
+++ b/ui/src/components/mail/compose.rs
@@ -713,7 +713,7 @@ impl Component for Composer {
}
}
- fn kill(&mut self, uuid: Uuid) {
+ fn kill(&mut self, uuid: Uuid, _context: &mut Context) {
self.mode = ViewMode::Discard(uuid);
}
diff --git a/ui/src/components/mail/view.rs b/ui/src/components/mail/view.rs
index aa3f04cc..0e7a24be 100644
--- a/ui/src/components/mail/view.rs
+++ b/ui/src/components/mail/view.rs
@@ -731,15 +731,16 @@ impl Component for MailView {
if let Some(u) = envelope.body(op).attachments().get(lidx) {
match u.content_type() {
ContentType::MessageRfc822 => {
- self.mode = ViewMode::Subview;
match EnvelopeWrapper::new(u.raw().to_vec()) {
Ok(wrapper) => {
- self.subview = Some(Box::new(EnvelopeView::new(
- wrapper,
- None,
- None,
- self.coordinates.0,
- )));
+ context.replies.push_back(UIEvent::Action(Tab(New(Some(
+ Box::new(EnvelopeView::new(
+ wrapper,
+ None,
+ None,
+ self.coordinates.0,
+ )),
+ )))));
}
Err(e) => {
context.replies.push_back(UIEvent::StatusEvent(
diff --git a/ui/src/components/mail/view/envelope.rs b/ui/src/components/mail/view/envelope.rs
index cc708868..3cb4a516 100644
--- a/ui/src/components/mail/view/envelope.rs
+++ b/ui/src/components/mail/view/envelope.rs
@@ -555,6 +555,14 @@ impl Component for EnvelopeView {
fn id(&self) -> ComponentId {
self.id
}
+
+ fn kill(&mut self, id: ComponentId, context: &mut Context) {
+ debug_assert!(self.id == id);
+ context
+ .replies
+ .push_back(UIEvent::Action(Tab(Kill(self.id))));
+ }
+
fn set_id(&mut self, id: ComponentId) {
self.id = id;
}