1
0
Fork 0
forked from alemi/upub

feat: logged in users can see their full outbox

This commit is contained in:
əlemi 2024-07-02 01:51:58 +02:00
parent a4df9f2fc0
commit 056be56843
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -19,14 +19,18 @@ pub async fn page(
AuthIdentity(auth): AuthIdentity, AuthIdentity(auth): AuthIdentity,
) -> crate::ApiResult<JsonLD<serde_json::Value>> { ) -> crate::ApiResult<JsonLD<serde_json::Value>> {
let uid = ctx.uid(&id); let uid = ctx.uid(&id);
crate::builders::paginate_feed( let mut filter = Condition::all()
upub::url!(ctx, "/actors/{id}/outbox/page"), .add(
Condition::all() Condition::any()
.add(auth.filter_activities())
.add(Condition::any()
.add(model::activity::Column::Actor.eq(&uid)) .add(model::activity::Column::Actor.eq(&uid))
.add(model::object::Column::AttributedTo.eq(&uid)) .add(model::object::Column::AttributedTo.eq(&uid))
), );
if !auth.is(&uid) {
filter = filter.add(auth.filter_activities());
}
crate::builders::paginate_feed(
upub::url!(ctx, "/actors/{id}/outbox/page"),
filter,
ctx.db(), ctx.db(),
page, page,
auth.my_id(), auth.my_id(),