aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2016-06-17 16:47:07 +0200
committerGitHub <noreply@github.com>2016-06-17 16:47:07 +0200
commite74ece931ed4ad44673f5add6680f32cadc04238 (patch)
treebb7e5ee380acd324f4fe287263429f6e7daf4f82 /wee_slack.py
parentba14f18befe03a9469940a94876d4f616421f56b (diff)
parent602fa9c2865d4708958b90f772df2744134a2fb4 (diff)
downloadwee-slack-e74ece931ed4ad44673f5add6680f32cadc04238.tar.gz
Merge pull request #204 from trygveaa/feat/set-localvar-channel-server
Set buffer localvars for channel and server
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index f12b295..5b0adaf 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -132,6 +132,7 @@ class SlackServer(object):
def __init__(self, token):
self.nick = None
self.name = None
+ self.team = None
self.domain = None
self.server_buffer_name = None
self.login_data = None
@@ -213,6 +214,7 @@ class SlackServer(object):
def connected_to_slack(self, login_data):
if login_data["ok"]:
+ self.team = login_data["team"]["domain"]
self.domain = login_data["team"]["domain"] + ".slack.com"
dbg("connected to {}".format(self.domain))
self.identifier = self.domain
@@ -419,6 +421,11 @@ class Channel(object):
w.buffer_set(self.channel_buffer, "localvar_set_type", 'private')
else:
w.buffer_set(self.channel_buffer, "localvar_set_type", 'channel')
+ if self.server.alias:
+ w.buffer_set(self.channel_buffer, "localvar_set_server", self.server.alias)
+ else:
+ w.buffer_set(self.channel_buffer, "localvar_set_server", self.server.team)
+ w.buffer_set(self.channel_buffer, "localvar_set_channel", self.name)
w.buffer_set(self.channel_buffer, "short_name", self.name)
buffer_list_update_next()