Добавить лицензию CC0 1.0

This commit is contained in:
AidarKC
2026-11-16 23:50:28 +03:00
parent 548160f7f8
commit c477560632
39 changed files with 901 additions and 138 deletions
+11 -5
View File
@@ -42,7 +42,8 @@ import {
DM_MAX_ATTACHMENTS_PER_MESSAGE,
} from '../services/dm-file-service.js';
import { createAttachmentCarouselElement } from '../services/attachment-format.js';
import { createDmFileAttachmentCard, isDmInlineMedia, resolveDmMediaUrl } from '../components/dm-attachments.js';
import { createDmFileAttachmentCard, createDmExpiredAttachmentCard, isDmInlineMedia, resolveDmMediaUrl } from '../components/dm-attachments.js';
import { isDmFileExpired } from '../services/dm-file-service.js';
import {
DM_HISTORY_PAGE_SIZE,
isDmHistoryFullyLoaded,
@@ -1217,7 +1218,12 @@ function renderLog(
const bubble = document.createElement('div');
const parsedText = parseDmTechBlocks(String(msg?.text || ''));
const dmAttachments = Array.isArray(parsedText.fileAttachments) ? parsedText.fileAttachments : (parsedText.fileAttachment ? [parsedText.fileAttachment] : []);
const rawDmAttachments = Array.isArray(parsedText.fileAttachments) ? parsedText.fileAttachments : (parsedText.fileAttachment ? [parsedText.fileAttachment] : []);
const dmAttachments = rawDmAttachments.map((attachment) => ({
...attachment,
senderLogin: msg?.from === 'out' ? state.session?.login : chatId,
messageTimestampMs: msgTimeMs,
}));
const autoKind = parsedText.callSummary ? 'call-tech' : (dmAttachments.length ? 'file-tech' : '');
const bubbleKind = String(msg?.kind || autoKind || '').trim();
bubble.className = `bubble ${msg.from}${bubbleKind ? ` ${bubbleKind}` : ''}`;
@@ -1280,9 +1286,9 @@ function renderLog(
for (const attachment of dmAttachments) {
if (media.includes(attachment)) continue;
attachmentsWrap.append(
attachment?.kind === 'voice'
? createDmVoiceAttachmentCard(attachment)
: createDmFileAttachmentCard(attachment),
isDmFileExpired(attachment)
? createDmExpiredAttachmentCard(attachment)
: (attachment?.kind === 'voice' ? createDmVoiceAttachmentCard(attachment) : createDmFileAttachmentCard(attachment)),
);
}
bubble.append(attachmentsWrap);