diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-08-29 00:48:16 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | 26f15a4a1572f529ff628df4e03dcd51da8f765a (patch) | |
tree | cf7000501158af93a9bbc6ab8eab13a0d08252f3 /slack/slack_message.py | |
parent | d6c04af249f3782c9f1e8241e5d76f023a94d992 (diff) | |
download | wee-slack-26f15a4a1572f529ff628df4e03dcd51da8f765a.tar.gz |
Show prefix for thread broadcast messages
Diffstat (limited to 'slack/slack_message.py')
-rw-r--r-- | slack/slack_message.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/slack/slack_message.py b/slack/slack_message.py index 1d61950..e304a9d 100644 --- a/slack/slack_message.py +++ b/slack/slack_message.py @@ -135,6 +135,10 @@ class SlackMessage: return self.thread_ts is not None and not self.is_thread_parent @property + def is_thread_broadcast(self) -> bool: + return self._message_json.get("subtype") == "thread_broadcast" + + @property def parent_message(self) -> Optional[SlackMessage]: if not self.is_reply or self.thread_ts is None: return None @@ -546,7 +550,12 @@ class SlackMessage: if not parent_message: return "" - text = f"[{parent_message.hash}]" + broadcast_text = ( + shared.config.look.thread_broadcast_prefix.value + if self.is_thread_broadcast + else "" + ) + text = f"[{broadcast_text}{parent_message.hash}]" return with_color(nick_color(str(parent_message.hash)), text) + " " def _create_thread_string(self) -> str: |