From 869c81eb79345f1da7b9ae91ad9fc8dc009603d1 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Thu, 18 Apr 2024 22:47:45 +0200 Subject: Add localvars for user status in IM buffers This can be used to e.g. show the user status emoji in the buflist like this: /set buflist.format.name "${name}${if:${buffer.local_variables.user_status_emoji}? ${buffer.local_variables.user_status_emoji}:}" --- slack/slack_conversation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'slack/slack_conversation.py') diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index e2e5599..cf98bb7 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -339,6 +339,15 @@ class SlackConversation(SlackBuffer): shared.config.color.buflist_muted_conversation.value, short_name ) + im_localvars = ( + { + "localvar_set_user_status_emoji": self._im_user.status_emoji, + "localvar_set_user_status_text": self._im_user.status_text, + } + if self._im_user + else {} + ) + return name, { "short_name": short_name, "title": self.buffer_title(), @@ -352,6 +361,7 @@ class SlackConversation(SlackBuffer): "localvar_set_server": self.workspace.name, "localvar_set_slack_muted": "1" if self.muted else "0", "localvar_set_completion_default_template": "${weechat.completion.default_template}|%(slack_channels)|%(slack_emojis)", + **im_localvars, } async def buffer_switched_to(self): -- cgit