aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-03-21 12:38:00 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2020-03-21 13:00:45 +0100
commitd36b1f201c7736cf1a257ccfe594feffe4e7cb28 (patch)
tree5f167c4785620a8a381c9c4e1712498c0bbb7da7 /wee_slack.py
parent9d20b09153d7fb89301716c54edf0f055cdfb711 (diff)
downloadwee-slack-d36b1f201c7736cf1a257ccfe594feffe4e7cb28.tar.gz
Use existing team_hash when creating SlackTeam
The team_hash is generated in handle_rtmstart, and it was generated again when instantiating SlackTeam. However, the parameters the two used were different, so they ended up with different hashes, and the check for existing teams in rtmstart would always be false. Fixes #734
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 82d9f6d..35170c6 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1243,9 +1243,10 @@ class SlackTeam(object):
Team object under which users and channels live.. Does lots.
"""
- def __init__(self, eventrouter, token, websocket_url, team_info, subteams, nick, myidentifier, my_manual_presence, users, bots, channels, **kwargs):
+ def __init__(self, eventrouter, token, team_hash, websocket_url, team_info, subteams, nick, myidentifier, my_manual_presence, users, bots, channels, **kwargs):
self.identifier = team_info["id"]
self.active = True
+ self.team_hash = team_hash
self.ws_url = websocket_url
self.connected = False
self.connecting_rtm = False
@@ -1275,7 +1276,6 @@ class SlackTeam(object):
self.channels = channels
self.users = users
self.bots = bots
- self.team_hash = SlackTeam.generate_team_hash(self.nick, self.subdomain)
self.name = self.domain
self.channel_buffer = None
self.got_history = True
@@ -2704,6 +2704,7 @@ def handle_rtmstart(login_data, eventrouter, team, channel, metadata):
t = SlackTeam(
eventrouter,
metadata.token,
+ th,
login_data['url'],
login_data["team"],
subteams,