diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-10-14 16:59:23 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | 08f29b315dd3e3234357e4ffadea4b1334f2539a (patch) | |
tree | 9d0961b2c487efa5ece2e1a6f2345286feab7517 /slack | |
parent | 205363244afab703127cbb8d836505684c73a284 (diff) | |
download | wee-slack-08f29b315dd3e3234357e4ffadea4b1334f2539a.tar.gz |
Remove color suffix from color option
It's redundant to have this when the options are in the color section.
Diffstat (limited to 'slack')
-rw-r--r-- | slack/config.py | 12 | ||||
-rw-r--r-- | slack/slack_message.py | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/slack/config.py b/slack/config.py index 3933aef..36e5726 100644 --- a/slack/config.py +++ b/slack/config.py @@ -25,9 +25,9 @@ class SlackConfigSectionColor: def __init__(self, weechat_config: WeeChatConfig): self._section = WeeChatSection(weechat_config, "color") - self.channel_mention_color = WeeChatOption( + self.channel_mention = WeeChatOption( self._section, - "channel_mention_color", + "channel_mention", "text color for mentioned channel names in the chat", WeeChatColor("blue"), ) @@ -97,16 +97,16 @@ class SlackConfigSectionColor: WeeChatColor("red"), ) - self.user_mention_color = WeeChatOption( + self.user_mention = WeeChatOption( self._section, - "user_mention_color", + "user_mention", "text color for mentioned user names in the chat", WeeChatColor("blue"), ) - self.usergroup_mention_color = WeeChatOption( + self.usergroup_mention = WeeChatOption( self._section, - "usergroup_mention_color", + "usergroup_mention", "text color for mentioned user group names in the chat", WeeChatColor("blue"), ) diff --git a/slack/slack_message.py b/slack/slack_message.py index dd19356..21402dd 100644 --- a/slack/slack_message.py +++ b/slack/slack_message.py @@ -185,7 +185,7 @@ class PendingMessageItem: conversation = await self.message.workspace.conversations[self.item_id] name = await conversation.name_with_prefix("short_name_without_padding") if self.display_type == "mention": - color = shared.config.color.channel_mention_color.value + color = shared.config.color.channel_mention.value elif self.display_type == "chat": color = "chat_channel" else: @@ -196,7 +196,7 @@ class PendingMessageItem: user = await self.message.workspace.users[self.item_id] if self.display_type == "mention": name = f"@{user.nick()}" - return with_color(shared.config.color.user_mention_color.value, name) + return with_color(shared.config.color.user_mention.value, name) elif self.display_type == "chat": return user.nick(colorize=True) else: @@ -206,11 +206,11 @@ class PendingMessageItem: # TODO: Handle error usergroup = await self.message.workspace.usergroups[self.item_id] name = f"@{usergroup.handle()}" - return with_color(shared.config.color.usergroup_mention_color.value, name) + return with_color(shared.config.color.usergroup_mention.value, name) elif self.item_type == "broadcast": name = f"@{self.item_id}" - return with_color(shared.config.color.usergroup_mention_color.value, name) + return with_color(shared.config.color.usergroup_mention.value, name) elif self.item_type == "message_nick": return await self.message.nick() |