refactor: standardize channel logging

This commit is contained in:
Peter Steinberger
2026-01-23 23:20:07 +00:00
parent 07ce1d73ff
commit aeb6b2ffad
16 changed files with 212 additions and 45 deletions

View File

@@ -23,6 +23,7 @@ import {
} from "../../auto-reply/reply/history.js";
import { buildMentionRegexes, matchesMentionPatterns } from "../../auto-reply/reply/mentions.js";
import { createReplyDispatcher } from "../../auto-reply/reply/reply-dispatcher.js";
import { logInboundDrop } from "../../channels/logging.js";
import { createReplyPrefixContext } from "../../channels/reply-prefix.js";
import { recordInboundSession } from "../../channels/session.js";
import { loadConfig } from "../../config/config.js";
@@ -384,7 +385,12 @@ export async function monitorIMessageProvider(opts: MonitorIMessageOpts = {}): P
});
const commandAuthorized = isGroup ? commandGate.commandAuthorized : dmAuthorized;
if (isGroup && commandGate.shouldBlock) {
logVerbose(`imessage: drop control command from unauthorized sender ${sender}`);
logInboundDrop({
log: logVerbose,
channel: "imessage",
reason: "control command (unauthorized)",
target: sender,
});
return;
}
const shouldBypassMention =