[Fix] Don't @ mention when doing reply in DM#7347
Conversation
sampaiodiego
left a comment
There was a problem hiding this comment.
thanks for this.. ❤️ I always remove the @mention 😂
| let text = `[ ](${ url }) `; | ||
|
|
||
| if (Session.get('openedRoom').indexOf(Meteor.userId()) === -1) { | ||
| text += `@${ message.u.username }`; |
There was a problem hiding this comment.
you're not adding an additional space after @mention as the previous code did.
There was a problem hiding this comment.
Oops! I was even thinking about it, I think I went back in and cleaned it out by mistake :(
Fixed now 👍
| const text = `[ ](${ url }) @${ message.u.username } `; | ||
| let text = `[ ](${ url }) `; | ||
|
|
||
| if (Session.get('openedRoom').indexOf(Meteor.userId()) === -1) { |
There was a problem hiding this comment.
I think it's safe doing RocketChat.models.Rooms.findOne(message.rid, { fields: { t: 1 } }) to get room's type =)
There was a problem hiding this comment.
That's a much cleaner way of doing it. Thanks!
|
@sampaiodiego Yes it always bugged me too! I couldn't take it any more I had to fix it 😂 Could you take another look? 😄 |
|
what if you reply to a message sent by yourself? 🤔 |
|
I think auto-replies should also remove @ my username |
|
@sampaiodiego @marceloschmidt ok if you reply to self now doesn't mention :) |
@RocketChat/core
Previously doing a reply in a DM mentioned them. Which is pointless. You don't need to mention the person you're sending the message directly to :)
There might be a better way of determining if the room type is DM. If so please suggest :)