summaryrefslogtreecommitdiff
path: root/alot/buffers
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-02-05 13:45:31 +0100
committerAnton Khirnov <anton@khirnov.net>2020-02-05 14:26:33 +0100
commite331cc44b672d39e09b5c971c4f3a99d5a3c93cc (patch)
tree3070b30c1ad593c1e68a3611a967285bd91d44c3 /alot/buffers
parent8fa596d425a563ab018be05e44b82d0ab76a6b31 (diff)
buffers/thread: drop support for auto-read tagging
It's pointless complexity that I do not need.
Diffstat (limited to 'alot/buffers')
-rw-r--r--alot/buffers/thread.py41
1 files changed, 1 insertions, 40 deletions
diff --git a/alot/buffers/thread.py b/alot/buffers/thread.py
index 74df6b15..faf3e3c2 100644
--- a/alot/buffers/thread.py
+++ b/alot/buffers/thread.py
@@ -29,10 +29,6 @@ class ThreadBuffer(Buffer):
self.thread = thread
self.message_count = thread.get_total_messages()
- # two semaphores for auto-removal of unread tag
- self._auto_unread_dont_touch_mids = set([])
- self._auto_unread_writing = False
-
self._indent_width = settings.get('thread_indent_replies')
self.rebuild()
Buffer.__init__(self, ui, self.body)
@@ -97,43 +93,8 @@ class ThreadBuffer(Buffer):
self._nested_tree = NestedTree(A, interpret_covered=True)
self.body = TreeBox(self._nested_tree)
- self.message_count = self.thread.get_total_messages()
- def render(self, size, focus=False):
- if self.message_count == 0:
- return self.body.render(size, focus)
-
- if settings.get('auto_remove_unread'):
- logging.debug('Tbuffer: auto remove unread tag from msg?')
- msg = self.get_selected_message()
- mid = msg.get_message_id()
- focus_pos = self.body.get_focus()[1]
- summary_pos = (self.body.get_focus()[1][0], (0,))
- cursor_on_non_summary = (focus_pos != summary_pos)
- if cursor_on_non_summary:
- if mid not in self._auto_unread_dont_touch_mids:
- if 'unread' in msg.get_tags():
- logging.debug('Tbuffer: removing unread')
-
- def clear():
- self._auto_unread_writing = False
-
- self._auto_unread_dont_touch_mids.add(mid)
- self._auto_unread_writing = True
- msg.remove_tags(['unread'], afterwards=clear)
- fcmd = commands.globals.FlushCommand(silent=True)
- asyncio.get_event_loop().create_task(
- self.ui.apply_command(fcmd))
- else:
- logging.debug('Tbuffer: No, msg not unread')
- else:
- logging.debug('Tbuffer: No, mid locked for autorm-unread')
- else:
- if not self._auto_unread_writing and \
- mid in self._auto_unread_dont_touch_mids:
- self._auto_unread_dont_touch_mids.remove(mid)
- logging.debug('Tbuffer: No, cursor on summary')
- return self.body.render(size, focus)
+ self.message_count = self.thread.get_total_messages()
def get_selected_mid(self):
"""Return Message ID of focussed message."""