- fn to_tombstone(&self) -> Result<Tombstone, LemmyError> {
- Ok(Tombstone::new(
- NoteType::Note,
- self.updated.unwrap_or(self.published),
- ))
+ #[tracing::instrument(skip_all)]
+ async fn verify(
+ note: &Note,
+ expected_domain: &Url,
+ context: &Data<LemmyContext>,
+ ) -> Result<(), LemmyError> {
+ verify_domains_match(note.id.inner(), expected_domain)?;
+ verify_domains_match(note.attributed_to.inner(), note.id.inner())?;
+ verify_is_public(¬e.to, ¬e.cc)?;
+ let community = note.community(context).await?;
+
+ check_apub_id_valid_with_strictness(note.id.inner(), community.local, context).await?;
+ verify_is_remote_object(note.id.inner(), context.settings())?;
+ verify_person_in_community(¬e.attributed_to, &community, context).await?;
+ let (post, _) = note.get_parents(context).await?;
+ if post.locked {
+ return Err(LemmyErrorType::PostIsLocked)?;
+ }
+ Ok(())