Compare commits

..

No commits in common. "b097e4a725a8f80abadac928fb1c4b318d2ea724" and "292cfe901113b365db7aa3fad2082b6a66db214a" have entirely different histories.

9 changed files with 3 additions and 23 deletions

View file

@ -36,7 +36,6 @@ pub async fn page(
ctx.db(),
page,
auth.my_id(),
false,
)
.await
}

View file

@ -25,7 +25,6 @@ pub async fn page(
ctx.db(),
page,
auth.my_id(),
false,
)
.await
}

View file

@ -42,7 +42,6 @@ pub async fn page(
ctx.db(),
page,
auth.my_id(),
false,
)
.await
}

View file

@ -1,5 +1,4 @@
use axum::{extract::{Query, State}, http::StatusCode, Json};
use sea_orm::{ColumnTrait, Condition};
use crate::{errors::UpubError, routes::activitypub::{CreationResult, JsonLD, Pagination}, server::{auth::AuthIdentity, Context}, url};
@ -14,13 +13,10 @@ pub async fn page(
) -> crate::Result<JsonLD<serde_json::Value>> {
crate::server::builders::paginate(
url!(ctx, "/outbox/page"),
Condition::all()
.add(auth.filter_condition())
.add(crate::model::actor::Column::Domain.eq(ctx.domain().to_string())),
auth.filter_condition(), // TODO filter local only stuff
ctx.db(),
page,
auth.my_id(),
true,
)
.await
}

View file

@ -42,7 +42,6 @@ pub async fn page(
ctx.db(),
page,
auth.my_id(),
false,
)
.await
}

View file

@ -30,7 +30,6 @@ pub async fn page(
ctx.db(),
page,
auth.my_id(),
false,
)
.await
}

View file

@ -1,5 +1,5 @@
use apb::{BaseMut, CollectionMut, CollectionPageMut};
use sea_orm::{Condition, DatabaseConnection, QueryFilter, QuerySelect, RelationTrait};
use sea_orm::{Condition, DatabaseConnection, QueryFilter, QuerySelect};
use crate::{model::{addressing::Event, attachment::BatchFillable}, routes::activitypub::{jsonld::LD, JsonLD, Pagination}};
@ -9,19 +9,11 @@ pub async fn paginate(
db: &DatabaseConnection,
page: Pagination,
my_id: Option<i64>,
with_users: bool, // TODO ewww too many arguments for this weird function...
) -> crate::Result<JsonLD<serde_json::Value>> {
let limit = page.batch.unwrap_or(20).min(50);
let offset = page.offset.unwrap_or(0);
let mut select = crate::model::addressing::Entity::find_addressed(my_id);
if with_users {
select = select
.join(sea_orm::JoinType::InnerJoin, crate::model::activity::Relation::Actors.def());
}
let items = select
let items = crate::model::addressing::Entity::find_addressed(my_id)
.filter(filter)
// TODO also limit to only local activities
.limit(limit)

View file

@ -21,7 +21,6 @@ pub fn App() -> impl IntoView {
.unwrap_or_default();
let home_tl = Timeline::new(format!("{URL_BASE}/users/{username}/inbox/page"));
let server_tl = Timeline::new(format!("{URL_BASE}/inbox/page"));
let local_tl = Timeline::new(format!("{URL_BASE}/outbox/page"));
let user_tl = Timeline::new(format!("{URL_BASE}/users/{username}/outbox/page"));
let context_tl = Timeline::new(format!("{URL_BASE}/outbox/page"));
@ -121,7 +120,6 @@ pub fn App() -> impl IntoView {
<Route path="/web/home" view=move || view! { <TimelinePage name="home" tl=home_tl /> } />
<Route path="/web/server" view=move || view! { <TimelinePage name="server" tl=server_tl /> } />
<Route path="/web/local" view=move || view! { <TimelinePage name="server" tl=local_tl /> } />
<Route path="/web/about" view=AboutPage />
<Route path="/web/config" view=move || view! { <ConfigPage setter=set_config /> } />

View file

@ -39,7 +39,6 @@ pub fn Navigator() -> impl IntoView {
<table class="align w-100">
<tr><td colspan="2"><a href="/web/home"><input class="w-100" type="submit" class:hidden=move || !auth.present() value="home timeline" /></a></td></tr>
<tr><td colspan="2"><a href="/web/server"><input class="w-100" type="submit" value="server timeline" /></a></td></tr>
<tr><td colspan="2"><a href="/web/local"><input class="w-100" type="submit" value="local timeline" /></a></td></tr>
<tr>
<td class="w-50"><a href="/web/about"><input class="w-100" type="submit" value="about" /></a></td>
<td class="w-50"><a href="/web/config"><input class="w-100" type="submit" value="config" /></a></td>