mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:50:43 +00:00
refactor: prune stale extension helpers
This commit is contained in:
@@ -2,7 +2,6 @@ import path from "node:path";
|
||||
import type {
|
||||
MatrixMessageAttachmentKind,
|
||||
MatrixMessageAttachmentSummary,
|
||||
MatrixMessageSummary,
|
||||
} from "./actions/types.js";
|
||||
|
||||
const MATRIX_MEDIA_KINDS: Record<string, MatrixMessageAttachmentKind> = {
|
||||
@@ -134,12 +133,6 @@ export function formatMatrixMessageText(params: {
|
||||
return `${body}\n\n${marker}`;
|
||||
}
|
||||
|
||||
export function formatMatrixMessageSummaryText(
|
||||
summary: Pick<MatrixMessageSummary, "body" | "attachment">,
|
||||
): string | undefined {
|
||||
return formatMatrixMessageText(summary);
|
||||
}
|
||||
|
||||
export function formatMatrixMediaUnavailableText(params: {
|
||||
body?: string;
|
||||
filename?: string;
|
||||
|
||||
@@ -55,10 +55,6 @@ export type PollStartSubtype = {
|
||||
answers: PollAnswer[];
|
||||
};
|
||||
|
||||
export type LegacyPollStartContent = {
|
||||
"m.poll"?: PollStartSubtype;
|
||||
};
|
||||
|
||||
export type PollStartContent = {
|
||||
[M_POLL_START]?: PollStartSubtype;
|
||||
[ORG_POLL_START]?: PollStartSubtype;
|
||||
|
||||
@@ -62,29 +62,6 @@ export function normalizeMatrixMessagingTarget(raw: string): string | undefined
|
||||
return normalized || undefined;
|
||||
}
|
||||
|
||||
export function normalizeMatrixDirectoryUserId(raw: string): string | undefined {
|
||||
const normalized = stripKnownPrefixes(raw, [MATRIX_PREFIX, USER_PREFIX]);
|
||||
if (!normalized || normalized === "*") {
|
||||
return undefined;
|
||||
}
|
||||
return isMatrixQualifiedUserId(normalized) ? `user:${normalized}` : normalized;
|
||||
}
|
||||
|
||||
export function normalizeMatrixDirectoryGroupId(raw: string): string | undefined {
|
||||
const normalized = stripKnownPrefixes(raw, [MATRIX_PREFIX]);
|
||||
if (!normalized || normalized === "*") {
|
||||
return undefined;
|
||||
}
|
||||
const lowered = normalizeLowercaseStringOrEmpty(normalized);
|
||||
if (lowered.startsWith(ROOM_PREFIX) || lowered.startsWith(CHANNEL_PREFIX)) {
|
||||
return normalized;
|
||||
}
|
||||
if (normalized.startsWith("!")) {
|
||||
return `room:${normalized}`;
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
export function resolveMatrixDirectUserId(params: {
|
||||
from?: string;
|
||||
to?: string;
|
||||
|
||||
Reference in New Issue
Block a user