From cd15b3a624ac7b57be93d58038ba8e4488f21e85 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 4 Feb 2021 23:39:05 -0800 Subject: [PATCH] Assume event_id and room_id from context for spec elision optimization. --- mautrix/client/api/events.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mautrix/client/api/events.py b/mautrix/client/api/events.py index 104c8624..f7089208 100644 --- a/mautrix/client/api/events.py +++ b/mautrix/client/api/events.py @@ -77,6 +77,10 @@ async def get_event(self, room_id: RoomID, event_id: EventID) -> Event: https://matrix.org/docs/spec/client_server/r0.5.0#get-matrix-client-r0-rooms-roomid-event-eventid """ content = await self.api.request(Method.GET, Path.rooms[room_id].event[event_id]) + if "event_id" not in content: + content["event_id"] = event_id + if "room_id" not in content: + content["room_id"] = room_id try: return Event.deserialize(content) except SerializerError as e: