From eb9a1b306a0df2410ace180178c6c9737d03d73d Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Thu, 7 Jun 2018 13:56:29 +0200 Subject: 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. --- wee_slack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wee_slack.py') 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 -- cgit