KI-AGENT: Matrix-Räume persistent verwalten

This commit is contained in:
2026-05-18 18:19:23 +02:00
parent 4d24e3a657
commit 6e14f48770
5 changed files with 294 additions and 23 deletions

View File

@@ -12,12 +12,24 @@ export default async function communicationRoutes(server: FastifyInstance) {
const roomOptionsFromRequest = (req: any) => {
const params = req.params as { roomKey?: string }
const body = (req.body || {}) as { key?: string, name?: string, topic?: string }
const body = (req.body || {}) as {
key?: string
name?: string
topic?: string
type?: string
entityType?: string | null
entityId?: number | null
entityUuid?: string | null
}
return {
key: params.roomKey || body.key,
name: body.name,
topic: body.topic,
type: body.type,
entityType: body.entityType,
entityId: body.entityId,
entityUuid: body.entityUuid,
}
}
@@ -125,7 +137,7 @@ export default async function communicationRoutes(server: FastifyInstance) {
server.get("/communication/matrix/rooms/:roomKey", async (req, reply) => {
try {
const params = req.params as { roomKey: string }
return await matrix.getTenantRoomStatus(req.user.tenant_id, params.roomKey, params.roomKey)
return await matrix.getTenantRoomStatus(req.user.tenant_id, params.roomKey)
} catch (err: any) {
return handleMatrixError(req, reply, err, "Matrix room status failed")
}