From 925278f11a5eb137c42b5232714c239fe7e25c3b Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Wed, 1 Mar 2017 10:58:46 -0500 Subject: Defer nick colourization to weechat's built in support Signed-off-by: Ben Kelly --- wee_slack.py | 18 +++++++----------- 1 file 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', -- cgit