aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-01-29 13:33:42 +0100
committerGitHub <noreply@github.com>2018-01-29 13:33:42 +0100
commitadffe461a65884310f5d2e8b5b2e61df2351860c (patch)
tree49d86705685c79f55965f109e9bf6022dc3c8823
parent8f08e20d0edb1a1aab692b54f507a70bc11a4320 (diff)
parent9369c3cb0106c81b9fdb1fdcd6201a50f61a8397 (diff)
downloadwee-slack-adffe461a65884310f5d2e8b5b2e61df2351860c.tar.gz
Merge pull request #499 from immae/presence_subscription
Temporary fix user presence subscription crashing big teams
-rw-r--r--wee_slack.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 9b63dea..38f14b7 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1152,9 +1152,14 @@ class SlackTeam(object):
c.update_nicklist(user.id)
def subscribe_users_presence(self):
+ # FIXME: There is a limitation in the API to the size of the
+ # json we can send.
+ # We should try to be smarter to fetch the users whom we want to
+ # subscribe to.
+ users = self.users.keys()[0:750]
self.send_to_websocket({
"type": "presence_sub",
- "ids": self.users.keys(),
+ "ids": users,
}, expect_reply=False)
class SlackChannel(object):