add video
This commit is contained in:
@@ -479,6 +479,8 @@ export class AdminUserInsightsService {
|
||||
}
|
||||
if (type === 'IMAGE') return '[Изображение]';
|
||||
if (type === 'AUDIO' || type === 'VOICE') return '[Аудио]';
|
||||
if (type === 'VIDEO') return '[Видео]';
|
||||
if (type === 'VIDEO_NOTE') return '[Кружок]';
|
||||
if (type === 'FILE') return '[Файл]';
|
||||
if (type === 'POLL') return '[Опрос]';
|
||||
if (type === 'SYSTEM') return '[Системное сообщение]';
|
||||
|
||||
@@ -468,7 +468,7 @@ export class ChatService {
|
||||
if (room.type === 'E2E' && type === 'POLL') {
|
||||
throw new BadRequestException('Опросы недоступны в секретном E2E чате');
|
||||
}
|
||||
const allowedTypes = new Set(['TEXT', 'IMAGE', 'AUDIO', 'VOICE', 'FILE', 'EMOJI', 'POLL']);
|
||||
const allowedTypes = new Set(['TEXT', 'IMAGE', 'AUDIO', 'VOICE', 'VIDEO', 'VIDEO_NOTE', 'FILE', 'EMOJI', 'POLL']);
|
||||
if (!allowedTypes.has(type)) {
|
||||
throw new BadRequestException('Неподдерживаемый тип сообщения');
|
||||
}
|
||||
@@ -480,13 +480,13 @@ export class ChatService {
|
||||
if (poll.options.length < 2) {
|
||||
throw new BadRequestException('В опросе должно быть минимум 2 варианта');
|
||||
}
|
||||
} else if (type !== 'IMAGE' && type !== 'AUDIO' && type !== 'VOICE' && type !== 'FILE') {
|
||||
} else if (type !== 'IMAGE' && type !== 'AUDIO' && type !== 'VOICE' && type !== 'VIDEO' && type !== 'VIDEO_NOTE' && type !== 'FILE') {
|
||||
if (!content?.trim()) {
|
||||
throw new BadRequestException('Сообщение не может быть пустым');
|
||||
}
|
||||
}
|
||||
|
||||
if ((type === 'IMAGE' || type === 'AUDIO' || type === 'VOICE' || type === 'FILE') && !storageKey) {
|
||||
if ((type === 'IMAGE' || type === 'AUDIO' || type === 'VOICE' || type === 'VIDEO' || type === 'VIDEO_NOTE' || type === 'FILE') && !storageKey) {
|
||||
throw new BadRequestException('Не указан файл для отправки');
|
||||
}
|
||||
|
||||
@@ -1048,11 +1048,15 @@ export class ChatService {
|
||||
? '🎤 Голосовое'
|
||||
: message.type === 'AUDIO'
|
||||
? '🎵 Аудио'
|
||||
: message.type === 'FILE'
|
||||
? '📄 Файл'
|
||||
: message.type === 'IMAGE'
|
||||
? '📷 Фото'
|
||||
: '📎 Медиа';
|
||||
: message.type === 'VIDEO'
|
||||
? '🎬 Видео'
|
||||
: message.type === 'VIDEO_NOTE'
|
||||
? '⭕ Кружок'
|
||||
: message.type === 'FILE'
|
||||
? '📄 Файл'
|
||||
: message.type === 'IMAGE'
|
||||
? '📷 Фото'
|
||||
: '📎 Медиа';
|
||||
|
||||
for (const member of room.members) {
|
||||
if (member.userId === senderId) continue;
|
||||
|
||||
Reference in New Issue
Block a user