diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2018-06-07 13:56:29 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2018-06-07 14:45:55 +0200 |
commit | eb9a1b306a0df2410ace180178c6c9737d03d73d (patch) | |
tree | 7ddb305768a82b979aff20ebedea5f82cf3ac3f2 /wee_slack.py | |
parent | 164443ab9de3033aa3738dd34ea068053d6bf7fa (diff) | |
download | wee-slack-eb9a1b306a0df2410ace180178c6c9737d03d73d.tar.gz |
Don't assume all users.info responses are for external users
We might want to use this request for other users as well in the future,
so we shouldn't assume that all of the users received by it are external.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index edc33ec..b0516d8 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1975,7 +1975,8 @@ class SlackUser(object): # sure they're set self.profile = {} self.presence = kwargs.get("presence", "unknown") - self.is_external = False + self.deleted = kwargs.get("deleted", False) + self.is_external = "is_stranger" in kwargs for key, value in kwargs.items(): setattr(self, key, value) @@ -2360,7 +2361,6 @@ def handle_usersinfo(user_json, eventrouter, **kwargs): team = eventrouter.teams[request_metadata.team_hash] channel = team.channels[request_metadata.channel_identifier] user_info = user_json['user'] - user_info.update(is_external=True, deleted=False) user = SlackUser(**user_info) team.users[user_info['id']] = user |