join room before sending message

This commit is contained in:
Benjamin Böhmke
2021-09-18 12:12:54 +02:00
parent 624a1b2c08
commit 7ffa47c267
2 changed files with 29 additions and 1 deletions

View File

@@ -76,6 +76,11 @@ async def matrix_webhook(request):
else:
formatted_body = markdown(str(data["body"]), extensions=["extra"])
# try to join room first -> non none response means error
resp = await utils.join_room(data["room_id"])
if resp is not None:
return resp
content = {
"msgtype": "m.text",
"body": data["body"],