feat: finalize matrix platform audit and docs
This commit is contained in:
parent
6422c7db58
commit
4524a6abc8
30 changed files with 3093 additions and 176 deletions
|
|
@ -1,14 +1,14 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import structlog
|
||||
from typing import Any
|
||||
|
||||
import structlog
|
||||
from nio.api import RoomVisibility
|
||||
from nio.responses import RoomCreateError
|
||||
|
||||
from adapter.matrix.store import (
|
||||
get_user_meta,
|
||||
next_chat_id,
|
||||
next_platform_chat_id,
|
||||
set_room_meta,
|
||||
set_user_meta,
|
||||
)
|
||||
|
|
@ -62,6 +62,7 @@ async def provision_workspace_chat(
|
|||
|
||||
next_chat_index = int(user_meta.get("next_chat_index", 1))
|
||||
chat_id = f"C{next_chat_index}"
|
||||
platform_chat_id = await next_platform_chat_id(store)
|
||||
room_name = room_name_override or _default_room_name(chat_id)
|
||||
chat_resp = await client.room_create(
|
||||
name=room_name,
|
||||
|
|
@ -98,7 +99,7 @@ async def provision_workspace_chat(
|
|||
"display_name": room_name,
|
||||
"matrix_user_id": matrix_user_id,
|
||||
"space_id": space_id,
|
||||
"platform_chat_id": f"matrix:{chat_room_id}",
|
||||
"platform_chat_id": platform_chat_id,
|
||||
},
|
||||
)
|
||||
await chat_mgr.get_or_create(
|
||||
|
|
@ -118,7 +119,15 @@ async def provision_workspace_chat(
|
|||
}
|
||||
|
||||
|
||||
async def handle_invite(client: Any, room: Any, event: Any, platform, store, auth_mgr, chat_mgr) -> None:
|
||||
async def handle_invite(
|
||||
client: Any,
|
||||
room: Any,
|
||||
event: Any,
|
||||
platform,
|
||||
store,
|
||||
auth_mgr,
|
||||
chat_mgr,
|
||||
) -> None:
|
||||
matrix_user_id = getattr(event, "sender", "")
|
||||
display_name = getattr(room, "display_name", None) or matrix_user_id
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue