-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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: prevents user to restore message deleted by staff #22571
Conversation
It could only occur on message created by the user itself and deleted while the user was looking at the channel. It more generally fix the trash service which was not correctly setting the author of the delete.
def trash_message(message:, **) | ||
message.trash! | ||
def trash_message(message:, guardian:, **) | ||
message.trash!(guardian.user) |
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.
Oh damn I do forget this a lot, thanks for fixing
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.
Nice, LGTM
plugins/chat/assets/javascripts/discourse/models/chat-message.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
…rse into chat/can-restore-message
This pull request has been mentioned on Discourse Meta. There might be relevant details there: https://meta.discourse.org/t/user-can-restore-their-own-message-what-deleted-by-staff/268484/2 |
It could only occur on message created by the user itself and deleted while the user was looking at the channel.
It more generally fix the trash service which was not correctly setting the author of the delete.