aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-08-25 20:06:11 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-08-25 20:06:11 +0200
commit675eddac950dbeeae4d3e594592f96ce385fe236 (patch)
tree8affdcbca8a64e8dc67fd0e90901232f5f109937 /wee_slack.py
parentcfaa6ad2e4f27d89a8a671671cc0a2eb33f7021d (diff)
downloadwee-slack-675eddac950dbeeae4d3e594592f96ce385fe236.tar.gz
Fix process_subteam_created after adding is_member to SlackSubteam
This was broken in commit 6f9339b. I haven't verified that is_member is set to the correct value when a user group is created, because I don't have access to a slack team where I can create user groups right know.
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 bcc455a..164490d 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3182,14 +3182,15 @@ def process_reaction_removed(message_json, eventrouter, **kwargs):
def process_subteam_created(subteam_json, eventrouter, **kwargs):
team = kwargs['team']
subteam_json_info = subteam_json['subteam']
- subteam = SlackSubteam(team.identifier, **subteam_json_info)
+ is_member = team.myidentifier in subteam_json_info.get('users', [])
+ subteam = SlackSubteam(team.identifier, is_member=is_member, **subteam_json_info)
team.subteams[subteam_json_info['id']] = subteam
def process_subteam_updated(subteam_json, eventrouter, **kwargs):
team = kwargs['team']
current_subteam_info = team.subteams[subteam_json['subteam']['id']]
- is_member = team.myidentifier in subteam_json['subteam']['users']
+ is_member = team.myidentifier in subteam_json['subteam'].get('users', [])
new_subteam_info = SlackSubteam(team.identifier, is_member=is_member, **subteam_json['subteam'])
team.subteams[subteam_json['subteam']['id']] = new_subteam_info