-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Dont allow posts to deleted / removed communities. Fixes #1827 #1828
Dont allow posts to deleted / removed communities. Fixes #1827 #1828
Conversation
I think it is also possible to comment in deleted/removed posts. Could you add a check for that as well while you're at it? And for federation, you can do these same checks in CreateOrUpdatePost::verify() and CreateOrUpdateComment::verify(). |
@@ -56,6 +57,7 @@ impl PerformCrud for CreateComment { | |||
let community_id = post.community_id; | |||
|
|||
check_community_ban(local_user_view.person.id, community_id, context.pool()).await?; | |||
check_community_deleted_or_removed(community_id, context.pool()).await?; |
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.
The comment check is here.
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 mean that it also needs to check here if the post was deleted/removed.
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.
K I added this, but I'm not exactly sure how to extract the post in the CreateOrUpdateComment::verify()
function.
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 need to call self.object.get_parents()
4ae3c30
to
ec9e359
Compare
crates/apub/src/objects/comment.rs
Outdated
@@ -73,7 +73,7 @@ impl Note { | |||
Ok(&self.id) | |||
} | |||
|
|||
async fn get_parents( | |||
pub async fn get_parents( |
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.
Use pub(crate) please.
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, my bad
No description provided.