Skip to content

Commit

Permalink
Merge pull request #7347 from RocketChat/fix-reply-in-dm
Browse files Browse the repository at this point in the history
[Fix] Don't @ mention when doing reply in DM
  • Loading branch information
rodrigok committed Jun 30, 2017
2 parents 8912879 + fc4fbe7 commit dc795d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/rocketchat-lib/client/MessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ') ? '' : ' ';
}
Expand Down

0 comments on commit dc795d3

Please sign in to comment.