diff --git a/src/messaging/index.js b/src/messaging/index.js index 27998d47a0..0526cab7ae 100644 --- a/src/messaging/index.js +++ b/src/messaging/index.js @@ -48,6 +48,7 @@ Messaging.getMessages = async (params) => { messageData.isOwner = messageData.fromuid === parseInt(params.uid, 10); if (messageData.deleted && !messageData.isOwner) { messageData.content = '[[modules:chat.message-deleted]]'; + messageData.cleanedContent = messageData.content; } }); diff --git a/test/messaging.js b/test/messaging.js index 4929ae23fd..f4ab7e56e1 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -702,6 +702,7 @@ describe('Messaging Library', () => { assert.ifError(err); messages.forEach((msg) => { assert(!msg.deleted || msg.content === '[[modules:chat.message-deleted]]', msg.content); + assert(!msg.deleted || msg.cleanedContent, '[[modules:chat.message-deleted]]', msg.content); }); done(); }