X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapub%2Fsrc%2Fprotocol%2Fobjects%2Fpage.rs;h=ad89cf35b04607869957553e02a878f22cb564e4;hb=2423b89ced5c2d110c1284777407682f748a068f;hp=9bf8dbe59eafc857d44e5bfbd062ffb66402f10a;hpb=1c9f0c2bed51eb240d8514d28993c5516c019afc;p=lemmy.git diff --git a/crates/apub/src/protocol/objects/page.rs b/crates/apub/src/protocol/objects/page.rs index 9bf8dbe5..ad89cf35 100644 --- a/crates/apub/src/protocol/objects/page.rs +++ b/crates/apub/src/protocol/objects/page.rs @@ -63,8 +63,6 @@ pub struct Page { pub(crate) image: Option, pub(crate) comments_enabled: Option, pub(crate) sensitive: Option, - /// Deprecated, for compatibility with Lemmy 0.17 - pub(crate) stickied: Option, pub(crate) published: Option>, pub(crate) updated: Option>, pub(crate) language: Option, @@ -131,32 +129,16 @@ pub(crate) struct AttributedToPeertube { } impl Page { - /// Only mods can change the post's stickied/locked status. So if either of these is changed from - /// the current value, it is a mod action and needs to be verified as such. + /// Only mods can change the post's locked status. So if it is changed from the default value, + /// it is a mod action and needs to be verified as such. /// - /// Both stickied and locked need to be false on a newly created post (verified in [[CreatePost]]. + /// Locked needs to be false on a newly created post (verified in [[CreatePost]]. pub(crate) async fn is_mod_action( &self, context: &Data, ) -> Result { let old_post = self.id.clone().dereference_local(context).await; - - let featured_changed = Page::is_featured_changed(&old_post, &self.stickied); - let locked_changed = Page::is_locked_changed(&old_post, &self.comments_enabled); - Ok(featured_changed || locked_changed) - } - - pub(crate) fn is_featured_changed( - old_post: &Result, - new_featured_community: &Option, - ) -> bool { - if let Some(new_featured_community) = new_featured_community { - if let Ok(old_post) = old_post { - return new_featured_community != &old_post.featured_community; - } - } - - false + Ok(Page::is_locked_changed(&old_post, &self.comments_enabled)) } pub(crate) fn is_locked_changed(