aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-24 13:37:21 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-28 15:32:15 +0200
commit0e597eed1c9917d34388650bb27476e2a7656977 (patch)
treef22946e93dd49be301abcb9e5acd8a90d8550a82 /wee_slack.py
parent44a72f2bb49b5b322f24b88c2128e19674ae4b76 (diff)
downloadwee-slack-0e597eed1c9917d34388650bb27476e2a7656977.tar.gz
Separate mentions and highlights in channels
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 25132df..4408480 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1368,11 +1368,16 @@ class SlackChannel(object):
def set_related_server(self, team):
self.team = team
+ def mentions(self):
+ return {'@' + self.team.nick, self.team.myidentifier}
+
+ def highlights(self):
+ return self.team.highlight_words.union(self.mentions()).union({"!here", "!channel", "!everyone"})
+
def set_highlights(self):
# highlight my own name and any set highlights
if self.channel_buffer:
- highlights = self.team.highlight_words.union({'@' + self.team.nick, self.team.myidentifier, "!here", "!channel", "!everyone"})
- h_str = ",".join(highlights)
+ h_str = ",".join(self.highlights())
w.buffer_set(self.channel_buffer, "highlight_words", h_str)
def create_buffer(self):