diff options
Diffstat (limited to 'alot/commands/thread.py')
-rw-r--r-- | alot/commands/thread.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 468ae149..6f83083a 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -747,52 +747,6 @@ class PipeCommand(Command): ui.notify(self.done_msg) -@registerCommand(MODE, 'remove', arguments=[ - (['--all'], {'action': 'store_true', 'help': 'remove whole thread'})]) -class RemoveCommand(Command): - - """remove message(s) from the index""" - repeatable = True - - def __init__(self, all=False, **kwargs): - """ - :param all: remove all messages from thread, not just selected one - :type all: bool - """ - Command.__init__(self, **kwargs) - self.all = all - - async def apply(self, ui): - threadbuffer = ui.current_buffer - # get messages and notification strings - if self.all: - thread = threadbuffer.get_selected_thread() - tid = thread.get_thread_id() - messages = thread.get_messages().keys() - confirm_msg = 'remove all messages in thread?' - ok_msg = 'removed all messages in thread: %s' % tid - else: - msg = threadbuffer.get_selected_message() - messages = [msg] - confirm_msg = 'remove selected message?' - ok_msg = 'removed message: %s' % msg.get_message_id() - - # ask for confirmation - if (await ui.choice(confirm_msg, select='yes', cancel='no')) == 'no': - return - - # notify callback - def callback(): - threadbuffer.rebuild() - ui.notify(ok_msg) - - # remove messages - for m in messages: - ui.dbman.remove_message(m, afterwards=callback) - - await ui.apply_command(FlushCommand()) - - @registerCommand(MODE, 'print', arguments=[ (['--all'], {'action': 'store_true', 'help': 'print all messages'}), (['--raw'], {'action': 'store_true', 'help': 'pass raw mail string'}), |