mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-02-21 07:09:49 -05:00
pantalaimon: Don't forward messages if we think the room isn't joined
This commit is contained in:
parent
f875499d6b
commit
a9f6ad2c7e
@ -897,13 +897,22 @@ class ProxyDaemon:
|
|||||||
|
|
||||||
room_id = request.match_info["room_id"]
|
room_id = request.match_info["room_id"]
|
||||||
|
|
||||||
# The room is not in the joined rooms list, just forward it.
|
|
||||||
try:
|
try:
|
||||||
room = client.rooms[room_id]
|
room = client.rooms[room_id]
|
||||||
encrypt = room.encrypted
|
encrypt = room.encrypted
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
# The room is not in the joined rooms list, either the pan client
|
||||||
|
# didn't manage to sync the state or we're not joined, in either
|
||||||
|
# case send an error response.
|
||||||
if client.has_been_synced:
|
if client.has_been_synced:
|
||||||
return await self.forward_to_web(request, token=client.access_token)
|
return web.json_response(
|
||||||
|
{
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "You do not have permission to send the event."
|
||||||
|
},
|
||||||
|
headers=CORS_HEADERS,
|
||||||
|
status=403,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
logger.error(
|
logger.error(
|
||||||
"The internal Pantalaimon client did not manage "
|
"The internal Pantalaimon client did not manage "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user