diff --git a/Cargo.lock b/Cargo.lock index fc9bf02..e6edab0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4958,7 +4958,7 @@ dependencies = [ [[package]] name = "upub-web" -version = "0.4.0" +version = "0.4.1" dependencies = [ "apb", "base64 0.22.1", diff --git a/web/Cargo.toml b/web/Cargo.toml index ca432f2..24fd783 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "upub-web" -version = "0.4.0" +version = "0.4.1" edition = "2021" authors = [ "alemi " ] description = "web frontend for upub" diff --git a/web/index.html b/web/index.html index 069225c..50e2aa3 100644 --- a/web/index.html +++ b/web/index.html @@ -136,6 +136,13 @@ div.sep-top { border-top: 2px solid rgba(var(--accent-rgb), 0.45); } + div.quote { + border: 2px dotted var(--background-dim); + margin-top: 1em; + margin-left: 1em; + margin-bottom: 1em; + padding: 1em; + } hr.sticky { position: sticky; z-index: 100; diff --git a/web/src/objects/item.rs b/web/src/objects/item.rs index 48261f6..6b2155c 100644 --- a/web/src/objects/item.rs +++ b/web/src/objects/item.rs @@ -50,9 +50,19 @@ pub fn Object(object: crate::Object) -> impl IntoView { } }); - let quote_badge = object.quote_url() + let quote_block = object.quote_url() .id() .ok() + .and_then(|x| { + Some(view! { +
+ + + }) + }); + + let quote_badge = object.quote_url() + .id() .map(|x| { let href = Uri::web(U::Object, &x); view! { @@ -60,12 +70,13 @@ pub fn Object(object: crate::Object) -> impl IntoView { ">" - RE + quote " " } - }); + }) + .ok(); let tag_badges = object.tag() .flat() @@ -143,7 +154,10 @@ pub fn Object(object: crate::Object) -> impl IntoView { let post = match object.object_type() { // mastodon, pleroma, misskey Ok(apb::ObjectType::Note) => view! { -
{post_inner}
+
+ {post_inner} + {quote_block} +
}.into_view(), // lemmy with Page, peertube with Video Ok(apb::ObjectType::Document(t)) => view! { @@ -154,6 +168,7 @@ pub fn Object(object: crate::Object) -> impl IntoView { {object.name().unwrap_or_default().to_string()} {post_inner} + {quote_block} }.into_view(), @@ -163,12 +178,14 @@ pub fn Object(object: crate::Object) -> impl IntoView {

{object.name().unwrap_or_default().to_string()}


{post_inner} + {quote_block} }.into_view(), // everything else Ok(t) => view! {

{t.as_ref().to_string()}

{post_inner} + {quote_block} }.into_view(), // object without type? Err(_) => view! { missing object type }.into_view(), diff --git a/web/src/timeline/mod.rs b/web/src/timeline/mod.rs index 0503766..e74f9c2 100644 --- a/web/src/timeline/mod.rs +++ b/web/src/timeline/mod.rs @@ -126,6 +126,12 @@ pub async fn process_activities(activities: Vec, auth: Auth) if let Ok(attributed_to) = object.attributed_to().id() { actors_seen.insert(attributed_to); } + if let Ok(quote_id) = object.quote_url().id() { + if !gonna_fetch.contains("e_id) { + gonna_fetch.insert(quote_id.clone()); + sub_tasks.push(Box::pin(fetch_and_update_with_user(U::Object, quote_id, auth))); + } + } if let Ok(object_uri) = object.id() { cache::OBJECTS.store(&object_uri, Arc::new(object.clone())); } else {