summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/commands/envelope.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 45830988..72c9d42d 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -161,7 +161,6 @@ class SendCommand(Command):
"""
super().__init__()
self.mail = mail
- self.envelope_buffer = None
def _get_keys_addresses(self, envelope):
addresses = set()
@@ -181,12 +180,13 @@ class SendCommand(Command):
return recipients_addresses.issubset(keys_addresses)
async def apply(self, ui):
- envelope = None
+ envelope = None
+ envelope_buffer = None
if self.mail is None:
# needed to close later
- self.envelope_buffer = ui.current_buffer
- envelope = self.envelope_buffer.envelope
+ envelope_buffer = ui.current_buffer
+ envelope = envelope_buffer.envelope
# This is to warn the user before re-sending
# an already sent message in case the envelope buffer
@@ -293,8 +293,8 @@ class SendCommand(Command):
initial_tags = envelope.tags
logging.debug('mail sent successfully')
ui.clear_notify(clearme)
- if self.envelope_buffer is not None:
- cmd = commands.globals.BufferCloseCommand(self.envelope_buffer)
+ if envelope_buffer is not None:
+ cmd = commands.globals.BufferCloseCommand(envelope_buffer)
await ui.apply_command(cmd)
ui.notify('mail sent successfully')
if envelope is not None: