1
0
Fork 0
forked from alemi/upub

chore: comments, clearer code

This commit is contained in:
əlemi 2024-04-22 01:01:42 +02:00
parent 1171d4cd06
commit dfec715594
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -33,7 +33,7 @@ pub async fn page(
let offset = page.offset.unwrap_or(0); let offset = page.offset.unwrap_or(0);
let context = if id.starts_with('+') { let context = if id.starts_with('+') {
format!("https://{}", id.replacen('+', "", 1).replace('@', "/")) id.replacen('+', "https://", 1).replace('@', "/")
} else if id.starts_with("tag:") { } else if id.starts_with("tag:") {
id.clone() id.clone()
} else { } else {
@ -43,7 +43,6 @@ pub async fn page(
let items = model::addressing::Entity::find_objects() let items = model::addressing::Entity::find_objects()
.filter(auth.filter_condition()) .filter(auth.filter_condition())
.filter(model::object::Column::Context.eq(context)) .filter(model::object::Column::Context.eq(context))
// TODO also limit to only local activities
.order_by(model::addressing::Column::Published, Order::Desc) .order_by(model::addressing::Column::Published, Order::Desc)
.limit(limit) .limit(limit)
.offset(offset) .offset(offset)