-/// try to fetch the instance actor (to make things like instance rules available)
-pub(in crate::objects) async fn fetch_instance_actor_for_object(
- object_id: Url,
- context: &LemmyContext,
- request_counter: &mut i32,
-) {
- // try to fetch the instance actor (to make things like instance rules available)
- let instance_id = instance_actor_id_from_url(object_id);
- let site = ObjectId::<ApubSite>::new(instance_id.clone())
- .dereference(context, context.client(), request_counter)
+/// Try to fetch the instance actor (to make things like instance rules available).
+pub(in crate::objects) async fn fetch_instance_actor_for_object<T: Into<Url> + Clone>(
+ object_id: &T,
+ context: &Data<LemmyContext>,
+) -> Result<InstanceId, LemmyError> {
+ let object_id: Url = object_id.clone().into();
+ let instance_id = Site::instance_actor_id_from_url(object_id);
+ let site = ObjectId::<ApubSite>::from(instance_id.clone())
+ .dereference(context)