KI-AGENT: Nativen Matrix-Chat in FEDEO starten

This commit is contained in:
2026-05-18 17:41:31 +02:00
parent 5fca7792a2
commit 655459a46b
3 changed files with 312 additions and 18 deletions

View File

@@ -74,4 +74,27 @@ export default async function communicationRoutes(server: FastifyInstance) {
.send({ error: err.message || "Matrix room provisioning failed" })
}
})
server.get("/communication/matrix/rooms/general/messages", async (req, reply) => {
try {
return await matrix.getGeneralRoomMessages(req.user.user_id, req.user.tenant_id)
} catch (err: any) {
req.log.error(err)
return reply
.code(err.statusCode || 500)
.send({ error: err.message || "Matrix messages failed" })
}
})
server.post("/communication/matrix/rooms/general/messages", async (req, reply) => {
try {
const body = req.body as { text?: string }
return await matrix.sendGeneralRoomMessage(req.user.user_id, req.user.tenant_id, body.text || "")
} catch (err: any) {
req.log.error(err)
return reply
.code(err.statusCode || 500)
.send({ error: err.message || "Matrix message send failed" })
}
})
}