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,
) -> crate::ApiResult<JsonLD<serde_json::Value>> {
let uid = ctx.uid(&id);
crate::builders::paginate_feed(
upub::url!(ctx, "/actors/{id}/outbox/page"),
Condition::all()
.add(auth.filter_activities())
.add(Condition::any()
let mut filter = Condition::all()
.add(
Condition::any()
.add(model::activity::Column::Actor.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(),
page,
auth.my_id(),