diff --git a/web/src/components/activity.rs b/web/src/components/activity.rs index e3524396..a85cfad2 100644 --- a/web/src/components/activity.rs +++ b/web/src/components/activity.rs @@ -10,6 +10,11 @@ pub fn ActivityLine(activity: crate::Object) -> impl IntoView { let actor_id = activity.actor().id().unwrap_or_default(); let actor = CACHE.get_or(&actor_id, serde_json::Value::String(actor_id.clone()).into()); let kind = activity.activity_type().unwrap_or(apb::ActivityType::Activity); + let href = match kind { + apb::ActivityType::Follow => Uri::web(FetchKind::User, &object_id), + // TODO for update check what's being updated + _ => Uri::web(FetchKind::Object, &object_id), + }; view! {
@@ -17,7 +22,7 @@ pub fn ActivityLine(activity: crate::Object) -> impl IntoView { - + {kind.as_ref().to_string()} diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs index 60d86f24..f8058624 100644 --- a/web/src/components/timeline.rs +++ b/web/src/components/timeline.rs @@ -210,6 +210,7 @@ async fn process_activities(activities: Vec, auth: Auth) -> V let mut out = Vec::new(); for activity in activities { + let activity_type = activity.activity_type().unwrap_or(apb::ActivityType::Activity); // save embedded object if present if let Some(object) = activity.object().get() { // also fetch actor attributed to @@ -224,8 +225,12 @@ async fn process_activities(activities: Vec, auth: Auth) -> V } else { // try fetching it if let Some(object_id) = activity.object().id() { if !gonna_fetch.contains(&object_id) { + let fetch_kind = match activity_type { + apb::ActivityType::Follow => FetchKind::User, + _ => FetchKind::Object, + }; gonna_fetch.insert(object_id.clone()); - sub_tasks.push(Box::pin(fetch_and_update_with_user(FetchKind::Object, object_id, auth))); + sub_tasks.push(Box::pin(fetch_and_update_with_user(fetch_kind, object_id, auth))); } } }