Use cache for invite links

This commit is contained in:
Lonami Exo
2018-08-02 13:47:35 +02:00
parent 328f737ef7
commit 2ca8ddbfb4
2 changed files with 57 additions and 15 deletions

View File

@@ -196,9 +196,13 @@ class MemorySession(Session):
if phone:
result = self.get_entity_rows_by_phone(phone)
else:
username, _ = utils.parse_username(key)
if username:
username, invite = utils.parse_username(key)
if username and not invite:
result = self.get_entity_rows_by_username(username)
else:
key = utils.resolve_invite_link(key)[1]
if key:
result = self.get_entity_rows_by_id(key, exact=False)
elif isinstance(key, int):
result = self.get_entity_rows_by_id(key, exact)