-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] Don't @ mention when doing reply in DM #7347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're not adding an additional space after @mention
as the previous code did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)