diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-05 14:19:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-05 14:26:33 +0100 |
commit | f0f911b0063f737f81096078bcf0ba98f97b9c52 (patch) | |
tree | 977af38422c899c7b73dd6d04606737a605f810a /alot/commands/thread.py | |
parent | e331cc44b672d39e09b5c971c4f3a99d5a3c93cc (diff) |
Drop support for removing messages.
This functionality is too obscure and dangerous, it should be done
manually instead.
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'}), |