diff options
-rw-r--r-- | slack/config.py | 2 | ||||
-rw-r--r-- | slack/slack_conversation.py | 8 | ||||
-rw-r--r-- | slack/slack_message.py | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/slack/config.py b/slack/config.py index 38a069b..3933aef 100644 --- a/slack/config.py +++ b/slack/config.py @@ -159,7 +159,7 @@ class SlackConfigSectionLook: self.display_reaction_nicks = WeeChatOption( self._section, "display_reaction_nicks", - "display the name of the reacting user(s) after each reaction", + "display the name of the reacting user(s) after each reaction; can be overridden per buffer with the buffer localvar display_reaction_nicks", False, ) diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index d3f7763..2d6fc3b 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -380,6 +380,14 @@ class SlackConversation(SlackBuffer): return bool(weechat.config_string_to_boolean(buffer_value)) return shared.config.look.display_thread_replies_in_channel.value + def display_reaction_nicks(self) -> bool: + buffer_value = weechat.buffer_get_string( + self.buffer_pointer, "localvar_display_reaction_nicks" + ) + if buffer_value: + return bool(weechat.config_string_to_boolean(buffer_value)) + return shared.config.look.display_reaction_nicks.value + def should_display_message(self, message: SlackMessage) -> bool: return ( not message.is_reply diff --git a/slack/slack_message.py b/slack/slack_message.py index 1e7637e..0771b60 100644 --- a/slack/slack_message.py +++ b/slack/slack_message.py @@ -602,7 +602,7 @@ class SlackMessage: assert_never(shared.config.look.render_emoji_as.value) async def _create_reaction_string(self, reaction: SlackMessageReaction) -> str: - if shared.config.look.display_reaction_nicks: + if self.conversation.display_reaction_nicks(): # TODO: initialize_items? users = await gather( *(self.workspace.users[user_id] for user_id in reaction["users"]) |