aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-01-22 17:31:53 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2020-01-22 17:37:27 +0100
commite507325af162f8d1382c0aa86b13b10767b51041 (patch)
tree5aef2cc1cadf4dfdde4f09c525aa1b90c4aacd2f
parentab7d09e044be556873733ad83b083029e88bd65f (diff)
downloadwee-slack-e507325af162f8d1382c0aa86b13b10767b51041.tar.gz
Fetch members explicitly for SlackPrivateChannel
Like SlackSharedChannel, SlackPrivateChannel doesn't include members in the result from rtm.start, and we have to use conversations.info for them which doesn't include members either. Therefore, we have to call conconversations.members. I hadn't noticed that the members were missing because I only tested with channels with a short backlog, so the members were filled by the join messages which were still present in the history that were fetched.
-rw-r--r--wee_slack.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 73a93ff..fc26f20 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2102,6 +2102,13 @@ class SlackPrivateChannel(SlackGroupChannel):
super(SlackPrivateChannel, self).__init__(eventrouter, **kwargs)
self.type = "private"
+ 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.token, 'conversations.members', {'channel': self.identifier}, team_hash=team.team_hash, channel_identifier=self.identifier)
+ self.eventrouter.receive(s)
+
class SlackMPDMChannel(SlackChannel):
"""