aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2016-03-11 15:45:26 +0000
committerRyan Huber <rhuber@gmail.com>2016-03-11 15:45:26 +0000
commitd5bb96beb3c3c00d3bc8230c4927e176c69c9771 (patch)
tree214d44fd759914ab5715354d183a4669ccdf55a9
parent602ecac2b09aaa616361f37f7036e2816cab1f11 (diff)
parente63e11ffd40bb8e733d236ec096a90c1bc280fd0 (diff)
downloadwee-slack-d5bb96beb3c3c00d3bc8230c4927e176c69c9771.tar.gz
Merge pull request #173 from rawdigits/query-and-server_alias
Make /slack talk and friends work when server_alias is set
-rw-r--r--wee_slack.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index c258fb4..46643ec 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -147,6 +147,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()
@@ -175,7 +176,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):
@@ -219,6 +220,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