From e756052acaa5b95f5bf5584e5dc5c6bdfd1115ee Mon Sep 17 00:00:00 2001 From: bhc Date: Thu, 4 Apr 2024 12:09:23 +0300 Subject: [PATCH] Add deleted flag to messages and update delete logic --- src/controllers/message.controller.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/controllers/message.controller.ts b/src/controllers/message.controller.ts index a770507..21fa571 100644 --- a/src/controllers/message.controller.ts +++ b/src/controllers/message.controller.ts @@ -124,6 +124,7 @@ export default class MessageController { roomId: roomId, replyTo: replyTo, seen: false, + deleted: false, type: type, body: null, image: null, @@ -306,7 +307,13 @@ export default class MessageController { env.APP_DATABASE, env.MESSAGES_COLLECTION, messageId, - { body: "_deleted_" } + { + deleted: true, + type: "body", + body: "[deleted message]", + image: null, + audio: null, + } ); console.log(message);