From 9ace0cb957fe23e25d286aac9f1270cd6f7beedd Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 6 Mar 2020 12:50:51 +0100 Subject: commands/thread: stop calling get_email() unnecessarily --- alot/commands/thread.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'alot') diff --git a/alot/commands/thread.py b/alot/commands/thread.py index f34a371d..c302aad0 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -479,7 +479,6 @@ class EditNewCommand(Command): async def apply(self, ui): if not self.message: self.message = ui.current_buffer.get_selected_message() - mail = self.message.get_email() # copy most tags to the envelope tags = set(self.message.get_tags()) tags.difference_update({'inbox', 'sent', 'draft', 'killed', 'replied', @@ -493,8 +492,8 @@ class EditNewCommand(Command): to_copy = ['Subject', 'From', 'To', 'Cc', 'Bcc', 'In-Reply-To', 'References'] for key in to_copy: - value = mail.get(key, '') - if value: + if key in self.message.headers: + value = self.message.headers[key][0] envelope.add(key, value) # copy attachments -- cgit v1.2.3