refactor: share setup account config patch helper

This commit is contained in:
Peter Steinberger
2026-03-07 19:53:31 +00:00
parent 2ee8b807f8
commit b0ac284dae
11 changed files with 176 additions and 150 deletions

View File

@@ -10,6 +10,7 @@ import type {
} from "openclaw/plugin-sdk/zalouser";
import {
applyAccountNameToChannelSection,
applySetupAccountConfigPatch,
buildChannelSendResult,
buildBaseAccountStatusSnapshot,
buildChannelConfigSchema,
@@ -329,35 +330,12 @@ export const zalouserPlugin: ChannelPlugin<ResolvedZalouserAccount> = {
channelKey: "zalouser",
})
: namedConfig;
if (accountId === DEFAULT_ACCOUNT_ID) {
return {
...next,
channels: {
...next.channels,
zalouser: {
...next.channels?.zalouser,
enabled: true,
},
},
} as OpenClawConfig;
}
return {
...next,
channels: {
...next.channels,
zalouser: {
...next.channels?.zalouser,
enabled: true,
accounts: {
...next.channels?.zalouser?.accounts,
[accountId]: {
...next.channels?.zalouser?.accounts?.[accountId],
enabled: true,
},
},
},
},
} as OpenClawConfig;
return applySetupAccountConfigPatch({
cfg: next,
channelKey: "zalouser",
accountId,
patch: {},
});
},
},
messaging: {