From e63e11ffd40bb8e733d236ec096a90c1bc280fd0 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sat, 5 Mar 2016 13:16:10 +0100 Subject: Make /slack talk and friends work when server_alias is set We need to add the short name as an alias so current_domain_name is able to figure out which server the current buffer belongs to. Fixes: #158 --- wee_slack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wee_slack.py b/wee_slack.py index 6172636..fb7bc6b 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -139,6 +139,7 @@ class SlackServer(object): self.communication_counter = 0 self.message_buffer = {} self.ping_hook = None + self.alias = None self.identifier = None self.connect_to_slack() @@ -167,7 +168,7 @@ class SlackServer(object): channels.append(channel, channel.get_aliases()) def get_aliases(self): - aliases = [self.identifier, self.token, self.buffer] + aliases = filter(None, [self.identifier, self.token, self.buffer, self.alias]) return aliases def find(self, name, attribute): @@ -211,6 +212,7 @@ class SlackServer(object): alias = w.config_get_plugin("server_alias.{}".format(login_data["team"]["domain"])) if alias: self.server_buffer_name = alias + self.alias = alias else: self.server_buffer_name = self.domain -- cgit