feat: logged in users can see their full outbox
This commit is contained in:
parent
a4df9f2fc0
commit
056be56843
1 changed files with 10 additions and 6 deletions
|
@ -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(),
|
||||||
|
|
Loading…
Reference in a new issue