diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-03-06 12:50:51 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-03-06 12:50:51 +0100 |
commit | 9ace0cb957fe23e25d286aac9f1270cd6f7beedd (patch) | |
tree | db23d2889862198e788088da17d1ca8c4db9fb69 /alot/commands/thread.py | |
parent | 7f149c511a5170ee01fea05f9550ba4096bf8de8 (diff) |
commands/thread: stop calling get_email() unnecessarily
Diffstat (limited to 'alot/commands/thread.py')
-rw-r--r-- | alot/commands/thread.py | 5 |
1 files changed, 2 insertions, 3 deletions
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 |