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

FIX: prevents user to restore message deleted by staff #22571

Merged
merged 7 commits into from
Jul 13, 2023

Conversation

jjaffeux
Copy link
Contributor

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.

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.
@github-actions github-actions bot added the chat PRs which include a change to Chat plugin label Jul 12, 2023
def trash_message(message:, **)
message.trash!
def trash_message(message:, guardian:, **)
message.trash!(guardian.user)
Copy link
Contributor

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

Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

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

Nice, LGTM

@jjaffeux jjaffeux merged commit 32e32f4 into discourse:main Jul 13, 2023
11 of 12 checks passed
@jjaffeux jjaffeux deleted the chat/can-restore-message branch July 13, 2023 08:16
@discoursebot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat PRs which include a change to Chat plugin
3 participants