aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--slack/shared.py1
-rw-r--r--slack/slack_buffer.py6
-rw-r--r--slack/slack_message.py5
3 files changed, 11 insertions, 1 deletions
diff --git a/slack/shared.py b/slack/shared.py
index 1661a04..eeb6df5 100644
--- a/slack/shared.py
+++ b/slack/shared.py
@@ -29,6 +29,7 @@ class Shared:
self.config: SlackConfig
self.uncaught_errors: List[UncaughtError] = []
self.standard_emojis: Dict[str, Emoji]
+ self.highlight_tag = "highlight"
shared = Shared()
diff --git a/slack/slack_buffer.py b/slack/slack_buffer.py
index 9554db1..adad7b7 100644
--- a/slack/slack_buffer.py
+++ b/slack/slack_buffer.py
@@ -203,6 +203,12 @@ class SlackBuffer(ABC):
name, buffer_props = await self.get_name_and_buffer_props()
full_name = self.get_full_name(name)
+ buffer_props["highlight_tags"] = (
+ f"{buffer_props['highlight_tags']},{shared.highlight_tag}"
+ if buffer_props.get("highlight_tags")
+ else shared.highlight_tag
+ )
+
if switch:
buffer_props["display"] = "1"
diff --git a/slack/slack_message.py b/slack/slack_message.py
index c51c8b4..ddb2ceb 100644
--- a/slack/slack_message.py
+++ b/slack/slack_message.py
@@ -383,7 +383,10 @@ class SlackMessage:
elif priority == MessagePriority.LOW:
return None
elif priority == MessagePriority.NONE:
- return "notify_none"
+ tags = ["notify_none"]
+ if self.should_highlight(False):
+ tags.append(shared.highlight_tag)
+ return ",".join(tags)
else:
assert_never(priority)