diff options
-rw-r--r-- | alot/commands/thread.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 527c84cd..31b4b19f 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -512,21 +512,16 @@ class RemoveCommand(Command): if (yield ui.choice(confirm_msg, select='yes', cancel='no')) == 'no': return - # remove messages - try: - for m in messages: - ui.dbman.remove_message(m) - except DatabaseError, e: - err_msg = str(e) - ui.notify(err_msg, priority='error') - logging.debug(err_msg) - return + # notify callback + def callback(): + ui.notify(ok_msg) + ui.apply_command(RefreshCommand()) - # notify - ui.notify(ok_msg) + # remove messages + for m in messages: + ui.dbman.remove_message(m, afterwards=callback) - # refresh buffer - ui.apply_command(RefreshCommand()) + ui.apply_command(FlushCommand()) @registerCommand(MODE, 'print', arguments=[ |