- _request_counter: &mut i32,
- ) -> Result<ApubPerson, LemmyError> {
- verify_domains_match(&person.id, expected_domain)?;
- let actor_id = Some(person.id.clone().into());
- let name = person.preferred_username.clone();
- let display_name: Option<String> = person.name.clone();
- let bio = get_summary_from_string_or_source(&person.summary, &person.source);
- let shared_inbox = person.endpoints.shared_inbox.clone().map(|s| s.into());
- let bot_account = match person.kind {
- UserTypes::Person => false,
- UserTypes::Service => true,
- };
+ context: &Data<Self::DataType>,
+ ) -> Result<(), LemmyError> {
+ 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);
+ check_slurs(&person.preferred_username, slur_regex)?;
+ check_slurs_opt(&person.name, slur_regex)?;
+
+ verify_domains_match(person.id.inner(), expected_domain)?;
+ check_apub_id_valid_with_strictness(person.id.inner(), false, context).await?;