diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-07-26 01:34:58 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | ab6dfe135825c9287d2522c581315fe9ecb0cc2e (patch) | |
tree | 661013385c00922894ced9af37063b63d58310cf /slack/config.py | |
parent | 1b2f7742c9893a86bc150dcaec1b76b899f042be (diff) | |
download | wee-slack-ab6dfe135825c9287d2522c581315fe9ecb0cc2e.tar.gz |
Show nicks in nicklist
Diffstat (limited to 'slack/config.py')
-rw-r--r-- | slack/config.py | 30 |
1 files changed, 30 insertions, 0 deletions
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__( |