diff --git a/packages/rocketchat-lib/server/models/Rooms.js b/packages/rocketchat-lib/server/models/Rooms.js index 6f895e3df..95c90f0af 100644 --- a/packages/rocketchat-lib/server/models/Rooms.js +++ b/packages/rocketchat-lib/server/models/Rooms.js @@ -430,6 +430,10 @@ class ModelRooms extends RocketChat.models._Base { setLastMessageById(_id, lastMessage) { const query = { _id }; + if (lastMessage.t == 'e2e') { + lastMessage.msg = `${ TAPi18n.__('Encrypted_Message') }`; + } + const update = { $set: { lastMessage, @@ -443,6 +447,10 @@ class ModelRooms extends RocketChat.models._Base { const query = { _id }; const lastMessage = RocketChat.models.Messages.getLastVisibleMessageSentWithNoTypeByRoomId(_id); + if (lastMessage.t == 'e2e') { + lastMessage.msg = `${ TAPi18n.__('Encrypted_Message') }`; + } + const update = lastMessage ? { $set: { lastMessage,