Move mattermost channel implementation from core to extensions/mattermost plugin. Extract config schema, group mentions, normalize utilities, and all mattermost-specific logic (accounts, client, monitor, probe, send) into the extension. Update imports to use plugin SDK and local modules. Add channel metadata directly in plugin definition instead of using getChatChannelMeta. Update package.json with channel and install configuration.
15 lines
449 B
TypeScript
15 lines
449 B
TypeScript
import type { ChannelGroupContext } from "clawdbot/plugin-sdk";
|
|
|
|
import { resolveMattermostAccount } from "./mattermost/accounts.js";
|
|
|
|
export function resolveMattermostGroupRequireMention(
|
|
params: ChannelGroupContext,
|
|
): boolean | undefined {
|
|
const account = resolveMattermostAccount({
|
|
cfg: params.cfg,
|
|
accountId: params.accountId,
|
|
});
|
|
if (typeof account.requireMention === "boolean") return account.requireMention;
|
|
return true;
|
|
}
|