Skip to content

Commit

Permalink
Merge branch 'master' into fix-dbus
Browse files Browse the repository at this point in the history
  • Loading branch information
chookity-pokk committed Nov 2, 2024
2 parents 78129e4 + 46a762d commit 1a79444
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions pantalaimon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,27 @@ async def sync(self, request):
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)

Expand Down
2 changes: 2 additions & 0 deletions pantalaimon/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
extras_require={
"ui": [
"dbus-python >= 1.2, < 1.3",
"PyGObject >= 3.36, < 3.39",
"PyGObject >= 3.46, < 3.50",
"dasbus == 1.7",
"notify2 >= 0.3, < 0.4",
]
},
Expand Down

0 comments on commit 1a79444

Please sign in to comment.