feat: wire embeds into all message query and creation paths

Integrate embed infrastructure into the complete message flow:
- messages.ts: batch-fetch embeds in GET, resolve on POST, re-resolve on PATCH
- dm.ts: same pattern for DM messages with isDm=true
- search.ts: include embeds in all 4 search/around endpoints
- events.ts: embed resolution in WS message create/edit for both space and DM
- Fix embedClassifier.ts type errors (regex match undefined → null)
- Add embeds: [] to all inline MessageWithUser/DmMessageWithUser constructions
- Add embeds: [] to chatStore optimistic message
This commit is contained in:
Jannis Braun
2026-03-20 23:41:53 +01:00
parent 5fe25fb077
commit 01ee7ab67a
6 changed files with 93 additions and 13 deletions
+3 -3
View File
@@ -25,15 +25,15 @@ function extractYouTubeId(url: URL): string | null {
// /shorts/ID
const shortsMatch = path.match(/^\/shorts\/([A-Za-z0-9_-]+)/);
if (shortsMatch) return shortsMatch[1];
if (shortsMatch) return shortsMatch[1] ?? null;
// /embed/ID
const embedMatch = path.match(/^\/embed\/([A-Za-z0-9_-]+)/);
if (embedMatch) return embedMatch[1];
if (embedMatch) return embedMatch[1] ?? null;
// /v/ID (legacy)
const vMatch = path.match(/^\/v\/([A-Za-z0-9_-]+)/);
if (vMatch) return vMatch[1];
if (vMatch) return vMatch[1] ?? null;
}
return null;