fix(backend): raw update reaches every handler that declares it, contact list follows user updates

This commit is contained in:
hh committed 2026-10-14 05:25:45 +02:00
1 parent 59d0e2c8ad
commit 32d58193f3
1 file changed
+4 -4
@@ -24,8 +24,9 @@ _MODULES = (
read_receipts,
transcribed,
)
_REGISTRY: dict[type, RawHandler] = {
update_type: module.handle for module in _MODULES for update_type in module.HANDLES
_REGISTRY: dict[type, list[RawHandler]] = {
update_type: [module.handle for module in _MODULES if update_type in module.HANDLES]
for update_type in {kind for module in _MODULES for kind in module.HANDLES}
}
@@ -33,8 +34,7 @@ _REGISTRY: dict[type, RawHandler] = {
async def dispatch(
client: PyroClient, update: raw.base.Update, users: dict, chats: dict
) -> None:
handler = _REGISTRY.get(type(update))
if handler is not None:
for handler in _REGISTRY.get(type(update), ()):
await handler(client, update, users, chats)