mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-05-19 09:28:04 +00:00
Add function ObjectId.is_local
This commit is contained in:
parent
779313ac22
commit
579319e755
|
@ -169,6 +169,11 @@ where
|
|||
Kind::verify(&res.object, redirect_url, data).await?;
|
||||
Kind::from_json(res.object, data).await
|
||||
}
|
||||
|
||||
/// Returns true if the object's domain matches the one defined in [[FederationConfig.domain]].
|
||||
pub fn is_local(&self, data: &Data<<Kind as Object>::DataType>) -> bool {
|
||||
data.config.is_local_url(&self.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Need to implement clone manually, to avoid requiring Kind to be Clone
|
||||
|
|
Loading…
Reference in a new issue