aboutsummaryrefslogtreecommitdiffstats
path: root/slack
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2024-04-18 22:47:45 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-04-18 22:47:58 +0200
commit869c81eb79345f1da7b9ae91ad9fc8dc009603d1 (patch)
treeaffe82b8d3f940e8307a2c205a0ed4a5f0bd19e7 /slack
parent12908fe6cfe53210dfea127a840dd3e6e74b2499 (diff)
downloadwee-slack-master.tar.gz
Add localvars for user status in IM buffersHEADnightlymaster
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}:}"
Diffstat (limited to 'slack')
-rw-r--r--slack/slack_conversation.py10
1 files changed, 10 insertions, 0 deletions
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):