aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Kelly <bk@ancilla.ca>2017-03-01 10:58:46 -0500
committerBen Kelly <btk@google.com>2017-04-13 11:32:17 -0400
commit925278f11a5eb137c42b5232714c239fe7e25c3b (patch)
tree61eee58ab82456ff4d66cdb034746c6bb5f86611
parent0d74722da5943ce3adfb460e581c2485baa0be65 (diff)
downloadwee-slack-925278f11a5eb137c42b5232714c239fe7e25c3b.tar.gz
Defer nick colourization to weechat's built in support
Signed-off-by: Ben Kelly <btk@google.com>
-rw-r--r--wee_slack.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/wee_slack.py b/wee_slack.py
index e8b736c..9b8892c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1631,18 +1631,15 @@ class SlackUser(object):
self.color_name = color_name
self.color = w.color(self.color_name)
def update_color(self):
- if config.colorize_nicks:
- self.color_name = w.info_get('irc_nick_color_name', self.name.encode('utf-8'))
- self.color = w.color(self.color_name)
- else:
- self.color = ""
- self.color_name = ""
+ # This will automatically be none/"" if the user has disabled nick
+ # colourization.
+ self.color_name = w.info_get('nick_color_name', self.name.encode('utf-8'))
+ self.color = w.color(self.color_name)
def formatted_name(self, prepend="", enable_color=True):
- if config.colorize_nicks and enable_color:
- print_color = self.color
+ if enable_color:
+ return self.color + prepend + self.name
else:
- print_color = ""
- return print_color + prepend + self.name
+ return prepend + self.name
class SlackBot(SlackUser):
"""
@@ -2910,7 +2907,6 @@ class PluginConfig(object):
# TODO: setting descriptions.
settings = {
'colorize_messages': 'false',
- 'colorize_nicks': 'true',
'colorize_private_chats': 'false',
'debug_mode': 'false',
'debug_level': '3',