Skip to content
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

Improvements to message quoting #3328

Merged
merged 1 commit into from
May 25, 2016
Merged

Improvements to message quoting #3328

merged 1 commit into from
May 25, 2016

Conversation

lucasvanhalst
Copy link
Contributor

@lucasvanhalst lucasvanhalst commented May 22, 2016

@RocketChat/core

Closes #3278

  • Fixes timestamp being incorrect when quoting a message
  • Hide message actions dropdown when clicking the "quote message" button
  • Make the timestamp from a quoted message clickable. When clicked it goes to the message.

@@ -5,7 +5,7 @@ Template.message.helpers
unless RocketChat.settings.get('UI_DisplayRoles')
return []
roles = _.union(UserRoles.findOne(this.u?._id)?.roles, RoomRoles.findOne({'u._id': this.u?._id, rid: this.rid })?.roles)
return _.compact(_.map(roles, (role) -> return RocketChat.models.Roles.findOne({ _id: role, description: { $exists: 1 } })?.description));
return RocketChat.models.Roles.find({_id: {$in: roles}, description: {$exists: true, $ne: ''}}, {_id: false, description: true})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to restrict fields returned from the query, you need to specify the fields property on the second parameter:

return RocketChat.models.Roles.find({ _id: { $in: roles }, description: { $exists: true, $ne: '' } }, { fields: { description: true } })

@sampaiodiego
Copy link
Member

thanks again for the contribution @lucasvanhalst =)

the function getPermaLink you created will not work when you are "sneak peek-ing" a channel because you don't have a subscription for a room once you join it.

@lucasvanhalst
Copy link
Contributor Author

@sampaiodiego hmm I see, but the cog which opens the message actions isn't visible when previewing a channel (it did when I made this, but not anymore on master) so that should never happen

@sampaiodiego
Copy link
Member

sampaiodiego commented May 23, 2016

cool.. I thought it was generating the link when rendering the quoted message (my mistake).. =)

@sampaiodiego sampaiodiego merged commit 8c25a68 into RocketChat:develop May 25, 2016
@lucasvanhalst lucasvanhalst deleted the quote_improvements branch May 25, 2016 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Quoted timestamps are wrong
2 participants