Ok(())
}
-fn verify_activity(activity: &dyn ActivityFields) -> Result<(), LemmyError> {
- check_is_apub_id_valid(activity.actor(), false)?;
+fn verify_activity(activity: &dyn ActivityFields, settings: &Settings) -> Result<(), LemmyError> {
+ check_is_apub_id_valid(activity.actor(), false, settings)?;
verify_domains_match(activity.id_unchecked(), activity.actor())?;
Ok(())
}
/// Generate a unique ID for an activity, in the format:
/// `http(s)://example.com/receive/create/202daf0a-1489-45df-8d2e-c8a3173fed36`
-fn generate_activity_id<T>(kind: T) -> Result<Url, ParseError>
+fn generate_activity_id<T>(kind: T, protocol_and_hostname: &str) -> Result<Url, ParseError>
where
T: ToString,
{
let id = format!(
"{}/activities/{}/{}",
- Settings::get().get_protocol_and_hostname(),
+ protocol_and_hostname,
kind.to_string().to_lowercase(),
Uuid::new_v4()
);