fix: invite uses payload not params, logger err

This commit is contained in:
əlemi 2024-01-29 23:58:50 +01:00
parent 1bc88cc48f
commit 296c4b423c
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -61,7 +61,7 @@ class AppService:
for doc in body["events"]:
event = Event(**doc)
if event.type not in EventType.all(): # TODO: python 3.12 makes the .all() unnecessary
self.logger.warn("unhandled event of type %s, ignoring", event["type"])
self.logger.warn("unhandled event of type %s, ignoring", event.type)
continue
self.logger.debug("dispatching event %s", event)
callback = self._callbacks.get(event.type, {}).get(event.room_id, None)
@ -156,7 +156,7 @@ class AppService:
method="POST",
url=f"{self.client_api}/rooms/{room}/invite",
headers=self.api_headers,
params={"user_id": mxid},
json={"user_id": mxid},
) as res:
res.raise_for_status()
self.logger.debug("invited %s to room %s : %s", mxid, room, await res.json())