aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2017-04-13 08:36:12 -0700
committerGitHub <noreply@github.com>2017-04-13 08:36:12 -0700
commitfada5b6a42f68e946538855ea8d3a7cd7a33e82f (patch)
treeac0291af2f398bc086b55de8dde5da17d810afb4 /wee_slack.py
parent5a865767f6463431cf1177f7b4a79b0fc2fcce1d (diff)
parent925278f11a5eb137c42b5232714c239fe7e25c3b (diff)
downloadwee-slack-fada5b6a42f68e946538855ea8d3a7cd7a33e82f.tar.gz
Merge pull request #339 from ToxicFrog/toxicfrog/nick-colours
Defer nick colourization to weechat's built in support
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/wee_slack.py b/wee_slack.py
index fb32829..3ad2b6a 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):
"""
@@ -2922,7 +2919,6 @@ class PluginConfig(object):
# TODO: setting descriptions.
settings = {
'colorize_messages': 'false',
- 'colorize_nicks': 'true',
'colorize_private_chats': 'false',
'debug_mode': 'false',
'debug_level': '3',