Skip to content

Commit

Permalink
voice message support
Browse files Browse the repository at this point in the history
  • Loading branch information
targoninc-alex committed Jun 30, 2024
1 parent f807205 commit d211e0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/features/liveFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d211e0e

Please sign in to comment.