Merge pull request #7347 from RocketChat/fix-reply-in-dm

[Fix] Don't @ mention when doing reply in DM
pull/7242/head^2
Rodrigo Nascimento 9 years ago committed by GitHub
commit dc795d3265
  1. 8
      packages/rocketchat-lib/client/MessageAction.js

@ -103,7 +103,13 @@ Meteor.startup(function() {
const message = this._arguments[1];
const input = instance.find('.input-message');
const url = RocketChat.MessageAction.getPermaLink(message._id);
const text = `[ ](${ url }) @${ message.u.username } `;
const roomInfo = RocketChat.models.Rooms.findOne(message.rid, { fields: { t: 1 } });
let text = `[ ](${ url }) `;
if (roomInfo.t !== 'd' && message.u.username !== Meteor.user().username) {
text += `@${ message.u.username } `;
}
if (input.value) {
input.value += input.value.endsWith(' ') ? '' : ' ';
}

Loading…
Cancel
Save