]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activities/mod.rs
Use audience field to federate items in groups (fixes #2464) (#2584)
[lemmy.git] / crates / apub / src / activities / mod.rs
index 3cf9771e13b912570b54a02a7842ee1600f95dd7..c38eadcda2a000ae8c74af1b70015fe80f27460f 100644 (file)
@@ -130,6 +130,16 @@ pub(crate) fn verify_is_public(to: &[Url], cc: &[Url]) -> Result<(), LemmyError>
   Ok(())
 }
 
+pub(crate) fn verify_community_matches(
+  a: &ApubCommunity,
+  b: CommunityId,
+) -> Result<(), LemmyError> {
+  if a.id != b {
+    return Err(LemmyError::from_message("Invalid community"));
+  }
+  Ok(())
+}
+
 pub(crate) fn check_community_deleted_or_removed(community: &Community) -> Result<(), LemmyError> {
   if community.deleted || community.removed {
     Err(LemmyError::from_message(