fix(gateway): run adapter config hooks for nested-only platform blocks
The plugin apply_yaml_config_fn dispatch loop only ran when a top-level platform block (e.g. `discord:`) existed. Configs that defined a platform only under `platforms.<name>` or `gateway.platforms.<name>` skipped the hook, so `platforms.discord.extra.allow_from` never reached DISCORD_ALLOWED_USERS. Fall back to those nested blocks when the top-level one is absent. Also map byquenox@gmail.com -> Que0x for the salvaged commits.
This commit is contained in:
@ -916,6 +916,18 @@ def load_gateway_config() -> GatewayConfig:
|
||||
if entry.apply_yaml_config_fn is None:
|
||||
continue
|
||||
platform_cfg = yaml_cfg.get(entry.name)
|
||||
# Fall back to the platform's block under ``platforms`` /
|
||||
# ``gateway.platforms`` so adapter hooks still run when the
|
||||
# user configured the platform only under those nested paths
|
||||
# (e.g. ``platforms.discord.extra.allow_from``) and not via a
|
||||
# top-level ``discord:`` block.
|
||||
if not isinstance(platform_cfg, dict):
|
||||
for _src in (gateway_platforms, yaml_cfg.get("platforms")):
|
||||
if isinstance(_src, dict):
|
||||
_candidate = _src.get(entry.name)
|
||||
if isinstance(_candidate, dict):
|
||||
platform_cfg = _candidate
|
||||
break
|
||||
if not isinstance(platform_cfg, dict):
|
||||
continue
|
||||
try:
|
||||
|
||||
@ -223,6 +223,7 @@ AUTHOR_MAP = {
|
||||
"264291321+v1b3coder@users.noreply.github.com": "v1b3coder",
|
||||
"silverchris@foxmail.com": "ming1523",
|
||||
"maksesipov@gmail.com": "Qwinty",
|
||||
"byquenox@gmail.com": "Que0x",
|
||||
"denisamania@gmail.com": "CalmProton",
|
||||
"308068+mbac@users.noreply.github.com": "mbac",
|
||||
"nicoechaniz@altermundi.net": "nicoechaniz",
|
||||
|
||||
Reference in New Issue
Block a user