diff options
author | Bill Doyle <vil@vil.lv> | 2021-05-11 15:11:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 21:11:23 +0200 |
commit | 33d167db20408cad4d635e69493ab7dbc67b12b2 (patch) | |
tree | 61f3ab0bd1f04f7bffda57b0a0616c1e69487e3e /wee_slack.py | |
parent | a191708db7a3edc99d9567efa523c75d03c134f3 (diff) | |
download | wee-slack-33d167db20408cad4d635e69493ab7dbc67b12b2.tar.gz |
Add indicator for broadcast thread messages (#838)
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index f8ea41d..62e1b0e 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2672,8 +2672,14 @@ class SlackChannel(SlackChannelCommon): text = message.render(force) if isinstance(message, SlackThreadMessage): thread_hash = self.hashed_messages[message.thread_ts] + if config.thread_broadcast_prefix and message.subtype == "thread_broadcast": + prefix = config.thread_broadcast_prefix + else: + prefix = "" + hash_str = colorize_string( - get_thread_color(str(thread_hash)), "[{}]".format(thread_hash) + get_thread_color(str(thread_hash)), + "[{}{}]".format(prefix, thread_hash), ) return "{} {}".format(hash_str, text) @@ -6425,6 +6431,11 @@ class PluginConfig(object): default="true", desc="When /joining a channel, automatically switch to it as well.", ), + "thread_broadcast_prefix": Setting( + default="+ ", + desc="Prefix to distinguish thread messages that were also sent " + "to the channel, when thread_messages_in_channel is enabled.", + ), "thread_messages_in_channel": Setting( default="false", desc="When enabled shows thread messages in the parent channel.", @@ -6541,6 +6552,7 @@ class PluginConfig(object): get_history_fetch_count = get_int get_map_underline_to = get_string get_muted_channels_activity = get_string + get_thread_broadcast_prefix = get_string get_render_bold_as = get_string get_render_italic_as = get_string get_shared_name_prefix = get_string |