diff options
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/globals.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 5090e653..4ce07a88 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -49,6 +49,15 @@ class ExitCommand(Command): msg_position='left')) == 'no': return + # check if there are any unsent messages + for buffer in ui.buffers: + if (isinstance(buffer, buffers.EnvelopeBuffer) and + not buffer.envelope.sent_time): + if (yield ui.choice('quit without sending message?', + select='yes', cancel='no', + msg_position='left')) == 'no': + raise CommandCanceled() + for b in ui.buffers: b.cleanup() ui.apply_command(FlushCommand(callback=ui.exit)) |