mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-01-21 04:41:01 -05:00
Merge pull request #151 from codemonium/decrypt-initial-dm
Decrypt initial message after joining new DM
This commit is contained in:
commit
a2a2d704ee
@ -795,6 +795,27 @@ class ProxyDaemon:
|
||||
body=await response.read(),
|
||||
)
|
||||
|
||||
async def createRoom(self, request):
|
||||
try:
|
||||
content = await request.json()
|
||||
except (JSONDecodeError, ContentTypeError):
|
||||
return self._not_json
|
||||
|
||||
invite = content.get("invite", ())
|
||||
if invite:
|
||||
access_token = self.get_access_token(request)
|
||||
|
||||
if not access_token:
|
||||
return self._missing_token
|
||||
|
||||
client = await self._find_client(access_token)
|
||||
if not client:
|
||||
return self._unknown_token
|
||||
|
||||
client.users_for_key_query.update(invite)
|
||||
|
||||
return await self.forward_to_web(request)
|
||||
|
||||
async def messages(self, request):
|
||||
access_token = self.get_access_token(request)
|
||||
|
||||
|
@ -70,6 +70,8 @@ async def init(data_dir, server_conf, send_queue, recv_queue):
|
||||
web.post("/_matrix/client/v3/login", proxy.login),
|
||||
web.get("/_matrix/client/r0/sync", proxy.sync),
|
||||
web.get("/_matrix/client/v3/sync", proxy.sync),
|
||||
web.post("/_matrix/client/r0/createRoom", proxy.createRoom),
|
||||
web.post("/_matrix/client/v3/createRoom", proxy.createRoom),
|
||||
web.get("/_matrix/client/r0/rooms/{room_id}/messages", proxy.messages),
|
||||
web.get("/_matrix/client/v3/rooms/{room_id}/messages", proxy.messages),
|
||||
web.put(
|
||||
|
Loading…
Reference in New Issue
Block a user