diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-05-25 16:18:24 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-05-25 16:20:07 +0200 |
commit | 3e8f96f6ca004be3f006d36d83f0430683b7eb76 (patch) | |
tree | ead49761856cc97edc96df97e225a094c57470b4 /wee_slack.py | |
parent | 5c3879f05a1e46a9752bfb519d442205e61590af (diff) | |
download | wee-slack-3e8f96f6ca004be3f006d36d83f0430683b7eb76.tar.gz |
Only fetch members for joined channels, when getting history
Fixes #775
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/wee_slack.py b/wee_slack.py index 0dbc01c..8c84b54 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2139,12 +2139,11 @@ class SlackPrivateChannel(SlackGroupChannel): def __init__(self, eventrouter, **kwargs): super(SlackPrivateChannel, self).__init__(eventrouter, "private", **kwargs) - def set_related_server(self, team): - super(SlackPrivateChannel, self).set_related_server(team) - # Fetch members here (after the team is known) since they aren't - # included in rtm.start - s = SlackRequest(team, 'conversations.members', {'channel': self.identifier}, channel=self) + def get_history(self, slow_queue=False): + # Fetch members since they aren't included in rtm.start + s = SlackRequest(self.team, 'conversations.members', {'channel': self.identifier}, channel=self) self.eventrouter.receive(s) + super(SlackPrivateChannel, self).get_history(slow_queue) class SlackMPDMChannel(SlackChannel): @@ -2192,18 +2191,14 @@ class SlackSharedChannel(SlackChannel): def __init__(self, eventrouter, **kwargs): super(SlackSharedChannel, self).__init__(eventrouter, "shared", **kwargs) - def set_related_server(self, team): - super(SlackSharedChannel, self).set_related_server(team) - # Fetch members here (after the team is known) since they aren't - # included in rtm.start - s = SlackRequest(team, 'conversations.members', {'channel': self.identifier}, channel=self) - self.eventrouter.receive(s) - def get_history(self, slow_queue=False): # Get info for external users in the channel for user in self.members - set(self.team.users.keys()): s = SlackRequest(self.team, 'users.info', {'user': user}, channel=self) self.eventrouter.receive(s) + # Fetch members since they aren't included in rtm.start + s = SlackRequest(self.team, 'conversations.members', {'channel': self.identifier}, channel=self) + self.eventrouter.receive(s) super(SlackSharedChannel, self).get_history(slow_queue) |