mirror of https://github.com/openclaw/openclaw.git
fix: honor googlechat account replyToMode
This commit is contained in:
parent
f08a1c34dd
commit
8e9607c064
|
|
@ -321,6 +321,31 @@ describe("googlechatPlugin outbound sendMedia", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("googlechatPlugin threading", () => {
|
||||
it("honors per-account replyToMode overrides", () => {
|
||||
const resolveReplyToMode = googlechatPlugin.threading?.resolveReplyToMode;
|
||||
if (!resolveReplyToMode) {
|
||||
throw new Error("Expected googlechatPlugin.threading.resolveReplyToMode to be defined");
|
||||
}
|
||||
|
||||
const cfg = {
|
||||
channels: {
|
||||
googlechat: {
|
||||
replyToMode: "all",
|
||||
accounts: {
|
||||
work: {
|
||||
replyToMode: "first",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig;
|
||||
|
||||
expect(resolveReplyToMode({ cfg, accountId: "work" })).toBe("first");
|
||||
expect(resolveReplyToMode({ cfg, accountId: "default" })).toBe("all");
|
||||
});
|
||||
});
|
||||
|
||||
const resolveTarget = googlechatPlugin.outbound?.resolveTarget;
|
||||
|
||||
describe("googlechatPlugin outbound resolveTarget", () => {
|
||||
|
|
|
|||
|
|
@ -343,7 +343,11 @@ export const googlechatPlugin = createChatChannelPlugin({
|
|||
collectWarnings: collectGoogleChatSecurityWarnings,
|
||||
},
|
||||
threading: {
|
||||
topLevelReplyToMode: "googlechat",
|
||||
scopedAccountReplyToMode: {
|
||||
resolveAccount: (cfg, accountId) => resolveGoogleChatAccount({ cfg, accountId }),
|
||||
resolveReplyToMode: (account) => account.config.replyToMode,
|
||||
fallback: "off",
|
||||
},
|
||||
},
|
||||
outbound: {
|
||||
base: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue