fixed duplicated messages

This commit is contained in:
slawk0
2024-11-30 23:13:14 +01:00
parent 2f48c7423b
commit 0e26a68f1c
2 changed files with 10 additions and 4 deletions

View File

@@ -71,7 +71,7 @@ function initializeSocket(io) {
socket.on("chat message", async (msg, callback) => {
const { message, recipient, attachment_url } = msg;
const sender = socket.user_id;
const sender = socket.username;
if (!message && !attachment_url) {
callback({
@@ -92,7 +92,7 @@ function initializeSocket(io) {
try {
const insertedMessage = await insertMessage(
sender,
socket.user_id,
recipient,
message,
attachment_url,