@ -7,7 +7,7 @@ use crate::{
community_outbox ::ApubCommunityOutbox ,
community_outbox ::ApubCommunityOutbox ,
} ,
} ,
local_site_data_cached ,
local_site_data_cached ,
objects ::{ community ::ApubCommunity , read_from_string_or_source_opt },
objects ::{ community ::ApubCommunity , read_from_string_or_source_opt , verify_is_remote_object },
protocol ::{
protocol ::{
objects ::{ Endpoints , LanguageTag } ,
objects ::{ Endpoints , LanguageTag } ,
ImageObject ,
ImageObject ,
@ -15,6 +15,7 @@ use crate::{
} ,
} ,
} ;
} ;
use activitypub_federation ::{
use activitypub_federation ::{
config ::Data ,
fetch ::{ collection_id ::CollectionId , object_id ::ObjectId } ,
fetch ::{ collection_id ::CollectionId , object_id ::ObjectId } ,
kinds ::actor ::GroupType ,
kinds ::actor ::GroupType ,
protocol ::{
protocol ::{
@ -75,10 +76,11 @@ impl Group {
pub ( crate ) async fn verify (
pub ( crate ) async fn verify (
& self ,
& self ,
expected_domain : & Url ,
expected_domain : & Url ,
context : & LemmyContext,
context : & Data< LemmyContext> ,
) -> LemmyResult < ( ) > {
) -> LemmyResult < ( ) > {
check_apub_id_valid_with_strictness ( self . id . inner ( ) , true , context ) . await ? ;
check_apub_id_valid_with_strictness ( self . id . inner ( ) , true , context ) . await ? ;
verify_domains_match ( expected_domain , self . id . inner ( ) ) ? ;
verify_domains_match ( expected_domain , self . id . inner ( ) ) ? ;
verify_is_remote_object ( & self . id , context ) ? ;
let local_site_data = local_site_data_cached ( & mut context . pool ( ) ) . await ? ;
let local_site_data = local_site_data_cached ( & mut context . pool ( ) ) . await ? ;
let slur_regex = & local_site_opt_to_slur_regex ( & local_site_data . local_site ) ;
let slur_regex = & local_site_opt_to_slur_regex ( & local_site_data . local_site ) ;