Skip to content
5 changes: 5 additions & 0 deletions .changeset/large-files-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed mentions not working when mentioned user changes username.
3 changes: 3 additions & 0 deletions apps/meteor/server/models/raw/Messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,9 @@ export class MessagesRaw extends BaseRaw<IMessage> implements IMessagesModel {
'mentions.$.username': newUsername,
'msg': newMessage,
},
$unset: {
md: 1,
},
};

return this.updateOne(query, update);
Expand Down