summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpazz <patricktotzke@gmail.com>2011-07-20 22:22:16 +0100
committerpazz <patricktotzke@gmail.com>2011-07-20 22:22:16 +0100
commitd6c27d6b65c138c652ca7d48d979eb61897adaa3 (patch)
treedd13559cc186871fb2c931d5712672e4dca76755
parent5e2eca8e2778ec4cd130af8881f01163e745c0a1 (diff)
parenta28ad390a2b53aa6b3290f257f98bc13adcb7b0c (diff)
Merge branch 'master' of github.com:pazz/notmuch-gui
-rw-r--r--alot/commands.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/alot/commands.py b/alot/commands.py
index 936a376b..2357db21 100644
--- a/alot/commands.py
+++ b/alot/commands.py
@@ -348,21 +348,17 @@ class ToggleThreadTagCommand(Command):
class SendMailCommand(Command):
- def __init__(self, email=None, envelope=None, **kwargs):
- self.email = email
- self.envelope_buffer = envelope
- Command.__init__(self, **kwargs)
def apply(self, ui):
- mail = ui.current_buffer.get_email()
+ envelope = ui.current_buffer
+ mail = envelope.get_email()
sname, saddr = email.Utils.parseaddr(mail.get('From'))
account = get_account_by_address(saddr)
if account:
success, reason = account.sender.send_mail(mail)
if success:
- if self.envelope_buffer: # close the envelope
- cmd = BufferCloseCommand(buffer=self.envelope_buffer)
- ui.apply_command(cmd)
+ cmd = BufferCloseCommand(buffer=envelope)
+ ui.apply_command(cmd)
ui.notify('mail send successful')
else:
ui.notify('failed to send: %s' % reason)