refactor: dedupe reply lowercase helpers

This commit is contained in:
Peter Steinberger
2026-04-07 10:48:12 +01:00
parent 3139d2007e
commit fbdb20ffd3
7 changed files with 22 additions and 12 deletions

View File

@@ -2,6 +2,7 @@ import { getChannelPlugin, listChannelPlugins } from "../channels/plugins/index.
import type { ChannelId, ChannelPlugin } from "../channels/plugins/types.js";
import { normalizeAnyChannelId } from "../channels/registry.js";
import type { OpenClawConfig } from "../config/config.js";
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
import {
INTERNAL_MESSAGE_CHANNEL,
@@ -466,7 +467,7 @@ function shouldUseFromAsSenderFallback(params: {
if (!from) {
return false;
}
const chatType = (params.chatType ?? "").trim().toLowerCase();
const chatType = normalizeLowercaseStringOrEmpty(params.chatType);
if (chatType && chatType !== "direct") {
return false;
}