diff options
Diffstat (limited to 'slack')
-rw-r--r-- | slack/config.py | 7 | ||||
-rw-r--r-- | slack/slack_message.py | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/slack/config.py b/slack/config.py index 9cca910..e7d9937 100644 --- a/slack/config.py +++ b/slack/config.py @@ -123,6 +123,13 @@ class SlackConfigSectionLook: " :]", ) + self.thread_broadcast_prefix = WeeChatOption( + self._section, + "thread_broadcast_prefix", + "prefix to distinguish thread messages that were also sent to the channel, when thread_messages_in_channel is enabled", + "+ ", + ) + self.color_nicks_in_nicklist = WeeChatOption( self._section, "color_nicks_in_nicklist", 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: |