feat(01-02): convert matrix archive and rename handlers to factories

- register archive and rename as client-aware closure handlers
- rename matrix rooms via stored surface_ref when a client is available
- keep archive scoped to core chat state for phase 1
This commit is contained in:
Mikhail Putilovskij 2026-04-02 22:51:01 +03:00
parent c8770da345
commit b7a04b6cf1
2 changed files with 35 additions and 14 deletions

View file

@ -1,10 +1,10 @@
from __future__ import annotations
from adapter.matrix.handlers.chat import (
handle_archive,
handle_list_chats,
make_handle_archive,
make_handle_new_chat,
handle_rename,
make_handle_rename,
)
from adapter.matrix.handlers.confirm import handle_cancel, handle_confirm
from adapter.matrix.handlers.settings import (
@ -25,8 +25,8 @@ from core.protocol import IncomingCallback, IncomingCommand
def register_matrix_handlers(dispatcher: EventDispatcher, client=None, store=None) -> None:
dispatcher.register(IncomingCommand, "new", make_handle_new_chat(client, store))
dispatcher.register(IncomingCommand, "chats", handle_list_chats)
dispatcher.register(IncomingCommand, "rename", handle_rename)
dispatcher.register(IncomingCommand, "archive", handle_archive)
dispatcher.register(IncomingCommand, "rename", make_handle_rename(client, store))
dispatcher.register(IncomingCommand, "archive", make_handle_archive(client, store))
dispatcher.register(IncomingCommand, "settings", handle_settings)
dispatcher.register(IncomingCommand, "settings_skills", handle_settings_skills)
dispatcher.register(IncomingCommand, "settings_connectors", handle_settings_connectors)