]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activities/create_or_update/post.rs
Add support for Featured Posts (#2585)
[lemmy.git] / crates / apub / src / activities / create_or_update / post.rs
index 92cc708774442b536332f468c71217c7eb67bdf3..69eae583c80f833d7d2d985bbeb546247d00a01c 100644 (file)
@@ -25,7 +25,7 @@ use activitypub_federation::{
 use activitystreams_kinds::public;
 use lemmy_api_common::{
   context::LemmyContext,
-  post::{CreatePost, EditPost, LockPost, PostResponse, StickyPost},
+  post::{CreatePost, EditPost, FeaturePost, LockPost, PostResponse},
   utils::get_local_user_view_from_jwt,
   websocket::{send::send_post_ws_message, UserOperationCrud},
 };
@@ -101,7 +101,7 @@ impl SendActivity for LockPost {
 }
 
 #[async_trait::async_trait(?Send)]
-impl SendActivity for StickyPost {
+impl SendActivity for FeaturePost {
   type Response = PostResponse;
 
   async fn send_activity(
@@ -205,9 +205,9 @@ impl ActivityHandler for CreateOrUpdatePage {
         // However, when fetching a remote post we generate a new create activity with the current
         // locked/stickied value, so this check may fail. So only check if its a local community,
         // because then we will definitely receive all create and update activities separately.
-        let is_stickied_or_locked =
+        let is_featured_or_locked =
           self.object.stickied == Some(true) || self.object.comments_enabled == Some(false);
-        if community.local && is_stickied_or_locked {
+        if community.local && is_featured_or_locked {
           return Err(LemmyError::from_message(
             "New post cannot be stickied or locked",
           ));