feat(task-7): verify matrix per-room context routing
This commit is contained in:
parent
c11c8ecfbf
commit
07c5078934
2 changed files with 56 additions and 3 deletions
|
|
@ -190,8 +190,11 @@ class MatrixBot:
|
|||
user=sender,
|
||||
)
|
||||
return
|
||||
chat_id = await resolve_chat_id(self.runtime.store, room.room_id, sender)
|
||||
incoming = from_room_event(event, room_id=room.room_id, chat_id=chat_id)
|
||||
local_chat_id = await resolve_chat_id(self.runtime.store, room.room_id, sender)
|
||||
dispatch_chat_id = local_chat_id
|
||||
if not body.startswith("!"):
|
||||
dispatch_chat_id = (room_meta or {}).get("platform_chat_id") or local_chat_id
|
||||
incoming = from_room_event(event, room_id=room.room_id, chat_id=dispatch_chat_id)
|
||||
if incoming is None:
|
||||
return
|
||||
try:
|
||||
|
|
@ -206,7 +209,7 @@ class MatrixBot:
|
|||
)
|
||||
outgoing = [
|
||||
OutgoingMessage(
|
||||
chat_id=chat_id,
|
||||
chat_id=dispatch_chat_id,
|
||||
text="Сервис временно недоступен. Попробуйте ещё раз позже."
|
||||
)
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue