Skip to content

Commit

Permalink
Regression: Remove added mentions on quote/reply
Browse files Browse the repository at this point in the history
  • Loading branch information
gdelavald authored and rodrigok committed Apr 24, 2018
1 parent d8afb60 commit 5ae7617
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/rocketchat-lib/client/MessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ Meteor.startup(function() {
action() {
const message = this._arguments[1];
const {input} = chatMessages[message.rid];
input.value = `@${ message.u.username } `;
$(input)
.focus()
.data('mention-user', true)
.data('reply', message)
.trigger('dataChange');
},
Expand Down Expand Up @@ -277,6 +277,7 @@ Meteor.startup(function() {
const {input} = chatMessages[message.rid];
$(input)
.focus()
.data('mention-user', false)
.data('reply', message)
.trigger('dataChange');
},
Expand Down
6 changes: 4 additions & 2 deletions packages/rocketchat-ui/client/lib/chatMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ this.ChatMessages = class ChatMessages {

let msg = '';
const reply = $(input).data('reply');
if (reply!==undefined) {
const mentionUser = $(input).data('mention-user') || false;

if (reply !== undefined) {
const url = RocketChat.MessageAction.getPermaLink(reply._id);
msg = `[ ](${ url }) `;
const roomInfo = RocketChat.models.Rooms.findOne(reply.rid, { fields: { t: 1 } });
if (roomInfo.t !== 'd' && reply.u.username !== Meteor.user().username) {
if (roomInfo.t !== 'd' && reply.u.username !== Meteor.user().username && mentionUser) {
msg += `@${ reply.u.username } `;
}
}
Expand Down

0 comments on commit 5ae7617

Please sign in to comment.