- async fn verify(
- &self,
- context: &Data<LemmyContext>,
- request_counter: &mut i32,
- ) -> Result<(), LemmyError> {
- verify_activity(&self.id, self.actor.inner(), &context.settings())?;
- verify_urls_match(self.to[0].inner(), self.object.inner())?;
- verify_person(&self.actor, context, request_counter).await?;
- let community = self.to[0].dereference(context, request_counter).await?;
- verify_person_in_community(&self.actor, &community, context, request_counter).await?;
+ type Error = LemmyError;
+
+ fn id(&self) -> &Url {
+ &self.id
+ }
+
+ fn actor(&self) -> &Url {
+ self.actor.inner()
+ }
+
+ #[tracing::instrument(skip_all)]
+ async fn verify(&self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
+ insert_received_activity(&self.id, context).await?;
+ verify_person(&self.actor, context).await?;
+ let object = self.object.dereference(context).await?;
+ if let UserOrCommunity::Community(c) = object {
+ verify_person_in_community(&self.actor, &c, context).await?;
+ }
+ if let Some(to) = &self.to {
+ verify_urls_match(to[0].inner(), self.object.inner())?;
+ }