mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 06:32:43 +00:00
fix: treat reply-to-bot as implicit mention across channels
This commit is contained in:
21
src/channels/mention-gating.ts
Normal file
21
src/channels/mention-gating.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export type MentionGateParams = {
|
||||
requireMention: boolean;
|
||||
canDetectMention: boolean;
|
||||
wasMentioned: boolean;
|
||||
implicitMention?: boolean;
|
||||
shouldBypassMention?: boolean;
|
||||
};
|
||||
|
||||
export type MentionGateResult = {
|
||||
effectiveWasMentioned: boolean;
|
||||
shouldSkip: boolean;
|
||||
};
|
||||
|
||||
export function resolveMentionGating(params: MentionGateParams): MentionGateResult {
|
||||
const implicit = params.implicitMention === true;
|
||||
const bypass = params.shouldBypassMention === true;
|
||||
const effectiveWasMentioned = params.wasMentioned || implicit || bypass;
|
||||
const shouldSkip =
|
||||
params.requireMention && params.canDetectMention && !effectiveWasMentioned;
|
||||
return { effectiveWasMentioned, shouldSkip };
|
||||
}
|
||||
Reference in New Issue
Block a user