Mattermost: dedupe replyToMode after rebase

This commit is contained in:
Muhammed Mukhthar CM
2026-03-12 08:37:33 +00:00
parent f595e99fba
commit eda7984624
3 changed files with 6 additions and 19 deletions

View File

@@ -274,13 +274,13 @@ export const mattermostPlugin: ChannelPlugin<ResolvedMattermostAccount> = {
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
},
threading: {
resolveReplyToMode: ({ cfg, accountId }) => {
resolveReplyToMode: ({ cfg, accountId, chatType }) => {
const account = resolveMattermostAccount({ cfg, accountId: accountId ?? "default" });
const mode = account.config.replyToMode;
if (mode === "off" || mode === "first") {
return mode;
}
return "all";
const kind =
chatType === "direct" || chatType === "group" || chatType === "channel"
? chatType
: "channel";
return resolveMattermostReplyToMode(account, kind);
},
},
reload: { configPrefixes: ["channels.mattermost"] },
@@ -343,16 +343,6 @@ export const mattermostPlugin: ChannelPlugin<ResolvedMattermostAccount> = {
groups: {
resolveRequireMention: resolveMattermostGroupRequireMention,
},
threading: {
resolveReplyToMode: ({ cfg, accountId, chatType }) => {
const account = resolveMattermostAccount({ cfg, accountId });
const kind =
chatType === "direct" || chatType === "group" || chatType === "channel"
? chatType
: "channel";
return resolveMattermostReplyToMode(account, kind);
},
},
actions: mattermostMessageActions,
directory: {
listGroups: async (params) => listMattermostDirectoryGroups(params),

View File

@@ -45,7 +45,6 @@ const MattermostAccountSchemaBase = z
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
replyToMode: z.enum(["off", "first", "all"]).optional(),
responsePrefix: z.string().optional(),
replyToMode: z.enum(["off", "first", "all"]).optional(),
actions: z
.object({
reactions: z.boolean().optional(),

View File

@@ -55,8 +55,6 @@ export type MattermostAccountConfig = {
blockStreaming?: boolean;
/** Merge streamed block replies before sending. */
blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
/** Control reply threading (off|first|all). Default: "all". */
replyToMode?: "off" | "first" | "all";
/** Outbound response prefix override for this channel/account. */
responsePrefix?: string;
/**