Fixing the video-to-file conversion error and audio appearance changes.

This commit is contained in:
2026-09-29 20:36:15 +03:30
parent 70bcd15847
commit 7996fc7f73
3 changed files with 109 additions and 38 deletions
@@ -450,9 +450,16 @@ export class ConversationsService {
} else if (lastType === 'video') {
preview = 'ویدیو';
} else if (lastType === 'file' || lastType === 'document' || lastType === 'attachment') {
preview = /\.(mp4|webm|mov|m4v|mkv|avi|3gp)(?:\?|$)/i.test(preview)
? 'ویدیو'
: 'فایل';
if (/\.(mp4|mov|m4v|mkv|avi|3gp)(?:\?|$)/i.test(preview)) {
preview = 'ویدیو';
} else if (
/(?:^|[\\/._-])voice(?:[\\/._-]|$)/i.test(preview) ||
/\.(webm|ogg|mp3|m4a|wav|aac|opus)(?:\?|$)/i.test(preview)
) {
preview = 'پیام صوتی';
} else {
preview = 'فایل';
}
}
const lastAtRaw =
lastMsg?.created_at ?? lastMsg?.createdAt ?? row.updated_at ?? row.updatedAt ?? null;