refactor(setup): share scoped config prelude

This commit is contained in:
Peter Steinberger
2026-03-17 03:53:17 +00:00
parent c51842660f
commit 4ae71485e9
7 changed files with 103 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
import {
applyAccountNameToChannelSection,
patchScopedAccountConfig,
prepareScopedSetupConfig,
} from "../../../src/channels/plugins/setup-helpers.js";
import {
setTopLevelChannelAllowFrom,
@@ -100,7 +100,7 @@ export function setIrcGroupAccess(
export const ircSetupAdapter: ChannelSetupAdapter = {
resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
applyAccountName: ({ cfg, accountId, name }) =>
applyAccountNameToChannelSection({
prepareScopedSetupConfig({
cfg,
channelKey: channel,
accountId,
@@ -118,7 +118,7 @@ export const ircSetupAdapter: ChannelSetupAdapter = {
},
applyAccountConfig: ({ cfg, accountId, input }) => {
const setupInput = input as IrcSetupInput;
const namedConfig = applyAccountNameToChannelSection({
const namedConfig = prepareScopedSetupConfig({
cfg,
channelKey: channel,
accountId,