]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activities/mod.rs
Add person name to PersonIsBannedFromSite error (#3786) (#3855)
[lemmy.git] / crates / apub / src / activities / mod.rs
index 885abc60308f3f8096f47d512ce3b33bc806bde3..ad04e861f7ffd4217496f87d1978101b5a706f7b 100644 (file)
@@ -97,7 +97,9 @@ pub(crate) async fn verify_person_in_community(
 ) -> Result<(), LemmyError> {
   let person = person_id.dereference(context).await?;
   if person.banned {
-    return Err(LemmyErrorType::PersonIsBannedFromSite)?;
+    return Err(LemmyErrorType::PersonIsBannedFromSite(
+      person.actor_id.to_string(),
+    ))?;
   }
   let person_id = person.id;
   let community_id = community.id;
@@ -143,7 +145,7 @@ pub(crate) async fn verify_mod_action(
 
 pub(crate) fn verify_is_public(to: &[Url], cc: &[Url]) -> Result<(), LemmyError> {
   if ![to, cc].iter().any(|set| set.contains(&public())) {
-    return Err(LemmyErrorType::ObjectIsNotPublic)?;
+    Err(LemmyErrorType::ObjectIsNotPublic)?;
   }
   Ok(())
 }
@@ -157,7 +159,7 @@ where
 {
   let b: ObjectId<ApubCommunity> = b.into();
   if a != &b {
-    return Err(LemmyErrorType::InvalidCommunity)?;
+    Err(LemmyErrorType::InvalidCommunity)?;
   }
   Ok(())
 }