From d211e0e78eab8f880e0b55b57e4e9344c422f631 Mon Sep 17 00:00:00 2001 From: alexa Date: Sun, 30 Jun 2024 19:40:10 +0200 Subject: [PATCH] voice message support --- src/features/liveFeature.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/liveFeature.ts b/src/features/liveFeature.ts index 25585ee..60b5927 100644 --- a/src/features/liveFeature.ts +++ b/src/features/liveFeature.ts @@ -2,7 +2,7 @@ import {MariaDbDatabase} from "./database/mariaDbDatabase"; import {ServerOptions, WebSocketServer} from "ws"; import {MessagingEndpoints} from "./messaging/endpoints"; import {CLI} from "../tooling/CLI"; -import {Attachment, User} from "./database/models"; +import {User} from "./database/models"; import {Application} from "express"; import {createServer} from "http"; import {UserWebSocket} from "./live/UserWebSocket"; @@ -135,8 +135,8 @@ export class LiveFeature { } const text = data.text; - if (!text) { - client.send(JSON.stringify({error: "Text is required"})); + if (!text && (!data.attachments || data.attachments.length === 0)) { + client.send(JSON.stringify({error: "Text or a single attachment is required"})); return; }