From ab6dfe135825c9287d2522c581315fe9ecb0cc2e Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Wed, 26 Jul 2023 01:34:58 +0200 Subject: Show nicks in nicklist --- slack/config.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'slack/config.py') diff --git a/slack/config.py b/slack/config.py index 8b60ac1..e7dbbaf 100644 --- a/slack/config.py +++ b/slack/config.py @@ -6,6 +6,7 @@ import weechat from slack.log import print_error from slack.shared import shared +from slack.slack_conversation import invalidate_nicklists from slack.slack_workspace import SlackWorkspace from slack.util import get_callback_name from slack.weechat_config import ( @@ -76,6 +77,15 @@ class SlackConfigSectionLook: " :]", ) + self.color_nicks_in_nicklist = WeeChatOption( + self._section, + "color_nicks_in_nicklist", + "use nick color in nicklist", + False, + parent_option="irc.look.color_nicks_in_nicklist", + callback_change=self.config_change_color_nicks_in_nicklist_cb, + ) + self.external_user_suffix = WeeChatOption( self._section, "external_user_suffix", @@ -83,6 +93,26 @@ class SlackConfigSectionLook: "*", ) + weechat.hook_config( + "weechat.look.nick_color_*", + get_callback_name(self.config_change_nick_colors_cb), + "", + ) + weechat.hook_config( + "weechat.color.chat_nick_colors", + get_callback_name(self.config_change_nick_colors_cb), + "", + ) + + def config_change_color_nicks_in_nicklist_cb( + self, option: WeeChatOption[WeeChatOptionType], parent_changed: bool + ): + invalidate_nicklists() + + def config_change_nick_colors_cb(self, data: str, option: str, value: str): + invalidate_nicklists() + return weechat.WEECHAT_RC_OK + class SlackConfigSectionWorkspace: def __init__( -- cgit