SHA256
Добавить ответы в DM и обновить UI чатов
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user