fix: let requireMentionInThread both relax and tighten the base setting
Remove the `requireMention &&` guard so requireMentionInThread works bidirectionally: a group with requireMention: false can now set requireMentionInThread: true to re-enable the mention requirement for thread replies specifically. Add test for the tightening edge case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
80daf16550
commit
85a1b9d710
@ -163,6 +163,17 @@ describe("feishu policy", () => {
|
||||
).toEqual({ requireMention: true });
|
||||
});
|
||||
|
||||
it("requireMentionInThread tightens when base requireMention is false", () => {
|
||||
expect(
|
||||
resolveFeishuReplyPolicy({
|
||||
isDirectMessage: false,
|
||||
isThreadReply: true,
|
||||
globalConfig: { requireMention: false } as FeishuConfig,
|
||||
groupConfig: { requireMentionInThread: true } as FeishuGroupConfig,
|
||||
}),
|
||||
).toEqual({ requireMention: true });
|
||||
});
|
||||
|
||||
it("does not apply thread override for non-thread messages", () => {
|
||||
expect(
|
||||
resolveFeishuReplyPolicy({
|
||||
|
||||
@ -116,7 +116,7 @@ export function resolveFeishuReplyPolicy(params: {
|
||||
const requireMention =
|
||||
params.groupConfig?.requireMention ?? params.globalConfig?.requireMention ?? true;
|
||||
|
||||
if (requireMention && params.isThreadReply) {
|
||||
if (params.isThreadReply) {
|
||||
const threadOverride =
|
||||
params.groupConfig?.requireMentionInThread ?? params.globalConfig?.requireMentionInThread;
|
||||
if (threadOverride !== undefined) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user