Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Smith <mrdoctorwho@helldev.net>2020-10-23 18:43:49 +0300
committerJohn Smith <mrdoctorwho@helldev.net>2020-10-23 18:43:49 +0300
commite379c936d17b0af2eb50efbf5f9d39a5e35a0ee8 (patch)
tree9fdf57d6e3831167e9d6339f4cb6a356aace5319
parente8c4d095e1abf3a64583e5395f6d5a48922b0dd2 (diff)
Make CHAT_USERS_LIMIT global
-rw-r--r--extensions/groupchats.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/extensions/groupchats.py b/extensions/groupchats.py
index aa4fff1..47e6f1b 100644
--- a/extensions/groupchats.py
+++ b/extensions/groupchats.py
@@ -408,7 +408,7 @@ class Chat(object):
"""
chat = user.vk.method("messages.getChat", {"chat_id": id})
users = chat.get("users", [])
- users = sorted(users[:CHAT_USERS_LIMIT])
+ users = sorted(users)[:CHAT_USERS_LIMIT]
if not chat:
raise RuntimeError("Unable to get a chat!")
return chat
@@ -560,6 +560,7 @@ def initChatExtension():
else:
logger.warning("not starting chats cleaner because CHAT_LIFETIME_LIMIT is not set")
if not isdef("CHAT_USERS_LIMIT"):
+ global CHAT_USERS_LIMIT
CHAT_USERS_LIMIT = 50