diff options
author | David Vo <auscompgeek@users.noreply.github.com> | 2017-07-28 13:55:51 +1000 |
---|---|---|
committer | David Vo <auscompgeek@users.noreply.github.com> | 2017-09-27 17:09:15 +1000 |
commit | 68f8f1e1b926fa47e4363f32e23932084dcea9a2 (patch) | |
tree | 0d4514d4224f505047bb4502274d83dd0fd3eee7 | |
parent | 2b5ac736bd2d5be567d12ea081f9f582bf98e18a (diff) | |
download | wee-slack-68f8f1e1b926fa47e4363f32e23932084dcea9a2.tar.gz |
Give groups a configurable buffer name prefix
-rw-r--r-- | wee_slack.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/wee_slack.py b/wee_slack.py index b5786bc..aa19a01 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1183,11 +1183,10 @@ class SlackChannel(object): w.buffer_set(self.channel_buffer, "hotlist", "1") def formatted_name(self, style="default", typing=False, **kwargs): - if config.channel_name_typing_indicator: - if not typing: - prepend = "#" - else: - prepend = ">" + if typing and config.channel_name_typing_indicator: + prepend = ">" + elif self.type == "group": + prepend = config.group_name_prefix else: prepend = "#" select = { @@ -1645,12 +1644,11 @@ class SlackGroupChannel(SlackChannel): def __init__(self, eventrouter, **kwargs): super(SlackGroupChannel, self).__init__(eventrouter, **kwargs) - self.name = "#" + kwargs['name'] self.type = "group" self.set_name(self.slack_name) def set_name(self, slack_name): - self.name = "#" + slack_name + self.name = config.group_name_prefix + slack_name # def formatted_name(self, prepend="#", enable_color=True, basic=False): # return prepend + self.slack_name @@ -3370,6 +3368,9 @@ class PluginConfig(object): 'distracting_channels': Setting( default='', desc='List of channels to hide.'), + 'group_name_prefix': Setting( + default='&', + desc='The prefix of buffer names for groups (private channels).'), 'map_underline_to': Setting( default='_', desc='When sending underlined text to slack, use this formatting' @@ -3480,6 +3481,7 @@ class PluginConfig(object): return int(w.config_get_plugin(key)) get_debug_level = get_int + get_group_name_prefix = get_string get_map_underline_to = get_string get_render_bold_as = get_string get_render_italic_as = get_string |