aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorAidan Epstein <aidan@jmad.org>2020-03-27 14:29:31 -0700
committerAidan Epstein <aidan@jmad.org>2020-03-27 14:29:31 -0700
commit3ee201b6d3d3f89cb99fb3f2bde54bc355a3e619 (patch)
treeb3ae83485cd76d089cc2c15e3330f1daf710c3e9 /wee_slack.py
parent7a2372b3c07f933726d388bab9a274f4d4f0a695 (diff)
downloadwee-slack-3ee201b6d3d3f89cb99fb3f2bde54bc355a3e619.tar.gz
Mark all threads as read when thread_messages_in_channel is set.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index bcb7f3e..9ae0cfa 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1598,6 +1598,9 @@ class SlackChannelCommon(object):
return self.messages[ts].hash
def mark_read(self, ts=None, update_remote=True, force=False, post_data={}):
+ if config.thread_messages_in_channel and getattr(self, thread_channels):
+ for channel in self.thread_channels.values():
+ channel.mark_read(ts, update_remote, force, post_data)
if self.new_messages or force:
if self.channel_buffer:
w.buffer_set(self.channel_buffer, "unread", "")
@@ -2275,8 +2278,10 @@ class SlackThreadChannel(SlackChannelCommon):
def refresh(self):
self.rename()
- def mark_read(self, ts=None, update_remote=True, force=False):
- super(SlackThreadChannel, self).mark_read(ts=ts, update_remote=update_remote, force=force, post_data={"thread_ts": self.parent_message.ts})
+ def mark_read(self, ts=None, update_remote=True, force=False, post_data={}):
+ args = {"thread_ts": self.parent_message.ts}
+ args.update(post_data)
+ super(SlackThreadChannel, self).mark_read(ts=ts, update_remote=update_remote, force=force, post_data=args)
def buffer_prnt(self, nick, text, timestamp, history_message=False, tag_nick=None):
data = "{}\t{}".format(format_nick(nick, self.last_line_from), text)