diff --git a/extensions/nextcloud-talk/src/onboarding.ts b/extensions/nextcloud-talk/src/onboarding.ts index 30cc2596acf..3ccf2851c3b 100644 --- a/extensions/nextcloud-talk/src/onboarding.ts +++ b/extensions/nextcloud-talk/src/onboarding.ts @@ -2,6 +2,7 @@ import { buildSingleChannelSecretPromptState, formatDocsLink, hasConfiguredSecretInput, + mapAllowFromEntries, mergeAllowFromEntries, promptSingleChannelSecretInput, resolveAccountIdForConfigure, @@ -29,7 +30,7 @@ function setNextcloudTalkDmPolicy(cfg: CoreConfig, dmPolicy: DmPolicy): CoreConf channel: "nextcloud-talk", dmPolicy, getAllowFrom: (inputCfg) => - (inputCfg.channels?.["nextcloud-talk"]?.allowFrom ?? []).map((entry) => String(entry)), + mapAllowFromEntries(inputCfg.channels?.["nextcloud-talk"]?.allowFrom), }) as CoreConfig; } diff --git a/src/channels/plugins/onboarding/helpers.test.ts b/src/channels/plugins/onboarding/helpers.test.ts index 9ceee484c77..f4d4c0c2f5a 100644 --- a/src/channels/plugins/onboarding/helpers.test.ts +++ b/src/channels/plugins/onboarding/helpers.test.ts @@ -984,7 +984,7 @@ describe("setTopLevelChannelDmPolicyWithAllowFrom", () => { channel: "nextcloud-talk", dmPolicy: "open", getAllowFrom: (inputCfg) => - (inputCfg.channels?.["nextcloud-talk"]?.allowFrom ?? []).map((entry) => String(entry)), + normalizeAllowFromEntries(inputCfg.channels?.["nextcloud-talk"]?.allowFrom ?? []), }); expect(next.channels?.["nextcloud-talk"]?.allowFrom).toEqual(["alice", "*"]); }); diff --git a/src/plugin-sdk/nextcloud-talk.ts b/src/plugin-sdk/nextcloud-talk.ts index df2f32535d3..1fd4d1d6010 100644 --- a/src/plugin-sdk/nextcloud-talk.ts +++ b/src/plugin-sdk/nextcloud-talk.ts @@ -36,6 +36,7 @@ export type { ChannelGroupContext, ChannelSetupInput } from "../channels/plugins export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; export { createReplyPrefixOptions } from "../channels/reply-prefix.js"; export type { OpenClawConfig } from "../config/config.js"; +export { mapAllowFromEntries } from "./channel-config-helpers.js"; export { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy,