refactor: prune stale extension helpers

This commit is contained in:
Peter Steinberger
2026-05-01 10:57:24 +01:00
parent ca620eaf35
commit 90554ea048
6 changed files with 0 additions and 59 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;