aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2016-03-05 13:16:10 +0100
committerTollef Fog Heen <tfheen@err.no>2016-03-05 13:16:10 +0100
commite63e11ffd40bb8e733d236ec096a90c1bc280fd0 (patch)
treee20ab6f236088d8bbfca13646235f709fca78e29
parentefb41803ed9293f0724da2c93898abd481a3a908 (diff)
downloadwee-slack-e63e11ffd40bb8e733d236ec096a90c1bc280fd0.tar.gz
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
-rw-r--r--wee_slack.py4
1 files changed, 3 insertions, 1 deletions
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