mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2024-10-01 03:35:38 -04:00
client: Fetch room members before the first encrytped send.
This commit is contained in:
parent
383f197e58
commit
a2d6f3cc84
@ -143,6 +143,8 @@ class PanClient(AsyncClient):
|
||||
self.task = None
|
||||
self.queue = queue
|
||||
|
||||
self.room_members_fetched = defaultdict(bool)
|
||||
|
||||
self.send_semaphores = defaultdict(asyncio.Semaphore)
|
||||
self.send_decision_queues = dict() # type: asyncio.Queue
|
||||
|
||||
|
@ -807,6 +807,17 @@ class ProxyDaemon:
|
||||
sem = client.send_semaphores[room_id]
|
||||
|
||||
async with sem:
|
||||
# Even though we request the full state we don't receive room
|
||||
# members since we're using lazy loading. The summary is for some
|
||||
# reason empty so nio can't know if room members are missing from
|
||||
# our state. Fetch the room members here instead.
|
||||
if not client.room_members_fetched[room_id]:
|
||||
try:
|
||||
await client.joined_members(room_id)
|
||||
client.room_members_fetched[room_id] = True
|
||||
except ClientConnectionError as e:
|
||||
return web.Response(status=500, text=str(e))
|
||||
|
||||
try:
|
||||
return await _send(self.conf.ignore_verification)
|
||||
except OlmTrustError as e:
|
||||
|
Loading…
Reference in New Issue
Block a user