From 6c212ffd4a2ccc8612d1197dd0c0c63e247f738a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 25 Apr 2020 16:55:11 +0200 Subject: commands/thread: stop using message widgets without reason This code only wants the messages themselves, not the widgets. --- alot/commands/thread.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'alot/commands/thread.py') diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 344cf35e..af5576cb 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -1058,16 +1058,14 @@ class TagCommand(Command): Command.__init__(self, **kwargs) async def apply(self, ui): - tbuffer = ui.current_buffer if self.all: - msg_wgts = list(tbuffer.message_widgets()) + messages = ui.current_buffer.thread.messages.values() else: - msg_wgts = [tbuffer.get_selected_message_widget()] + messages = [ui.current_buffer.get_selected_message()] tags = [t for t in self.tagsstring.split(',') if t] try: - for mt in msg_wgts: - m = mt.get_message() + for m in messages: if self.action == 'add': m.add_tags(tags) if self.action == 'set': -- cgit v1.2.3