Добавить ответы в DM и обновить UI чатов

This commit is contained in:
AidarKC
2026-07-10 19:27:49 +04:00
parent 0d2d7b6dc5
commit c9cfb394d7
10 changed files with 526 additions and 15 deletions
+8
View File
@@ -2,6 +2,7 @@ function defaultParsed(rawText = '') {
const text = String(rawText || '');
return {
rawText: text,
prefixText: '',
visibleText: text,
displayText: text,
blocks: [],
@@ -68,6 +69,12 @@ export function buildDmCallTechBlock({ status = '', durationSec = 0, reason = ''
return `<SHiNE:call;v=1;status=failed;reason=${cleanReason || 'connect_failed'}>`;
}
export function buildDmReplyTechBlock({ baseKey = '' } = {}) {
const cleanBaseKey = String(baseKey || '').trim();
if (!cleanBaseKey) return '';
return `<SHiNE:reply;v=1;id=${cleanBaseKey}>`;
}
export function parseDmTechBlocks(rawText = '') {
const text = String(rawText || '');
if (!text.startsWith('<SHiNE:')) return defaultParsed(text);
@@ -127,6 +134,7 @@ export function parseDmTechBlocks(rawText = '') {
const displayText = callSummary ? buildCallDisplayText(callSummary) : visibleText;
return {
rawText: text,
prefixText: text.slice(0, cursor),
visibleText,
displayText,
blocks,