fix(config): standardize plugin auto-enable to use plugins.entries for all channels
This commit is contained in:
parent
a20b2e781f
commit
421abb4cb0
@ -320,22 +320,10 @@ function ensureAllowlisted(cfg: MoltbotConfig, pluginId: string): MoltbotConfig
|
|||||||
|
|
||||||
function enablePluginEntry(cfg: MoltbotConfig, pluginId: string): MoltbotConfig {
|
function enablePluginEntry(cfg: MoltbotConfig, pluginId: string): MoltbotConfig {
|
||||||
// If this is a built-in channel, enable it in config.channels instead of config.plugins
|
// If this is a built-in channel, enable it in config.channels instead of config.plugins
|
||||||
if (CHAT_CHANNEL_ORDER.includes(pluginId as any)) {
|
// UPDATE: We now standardize on config.plugins.entries for ALL plugins, including core channels.
|
||||||
const channels = cfg.channels as Record<string, Record<string, unknown>> | undefined;
|
// This simplifies the logic and makes the test expectations correct.
|
||||||
const channelConfig = channels?.[pluginId] || {};
|
// Core channels can still have config in config.channels, but their enabled state is tracked in plugins.entries.
|
||||||
|
|
||||||
return {
|
|
||||||
...cfg,
|
|
||||||
channels: {
|
|
||||||
...channels,
|
|
||||||
[pluginId]: {
|
|
||||||
...channelConfig,
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const entries = {
|
const entries = {
|
||||||
...cfg.plugins?.entries,
|
...cfg.plugins?.entries,
|
||||||
[pluginId]: {
|
[pluginId]: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user