This commit is contained in:
lendry
2026-07-10 12:14:06 +03:00
parent a4b4577c55
commit a0966e7ba2
6 changed files with 112 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
import type { ChatMessage } from '@/lib/api';
import { isVideoNoteFileName } from '@/lib/chat-media';
import { emojiIdToNative, resolveNativeEmojiContent } from '@/lib/emoji-native-map';
export const QUICK_REACTIONS = ['👍', '❤️', '😂', '😮', '😢', '🙏', '🔥', '👏'] as const;
@@ -58,6 +59,16 @@ export function getMessagePreviewText(message: ChatMessage, visibleText?: string
if (message.type === 'IMAGE') return '📷 Фото';
if (message.type === 'VIDEO') return '🎬 Видео';
if (message.type === 'VIDEO_NOTE') return '⭕ Кружок';
if (message.type === 'VIDEO' || message.type === 'FILE') {
const meta = message.metadataJson ? (() => {
try {
return JSON.parse(message.metadataJson) as { fileName?: string; videoNote?: boolean };
} catch {
return {};
}
})() : {};
if (meta.videoNote || isVideoNoteFileName(meta.fileName || message.content)) return '⭕ Кружок';
}
if (message.type === 'LOCATION') return '📍 Геопозиция';
if (message.type === 'VOICE') return '🎤 Голосовое';
if (message.type === 'AUDIO') return '🎵 Аудио';