Query params in the timeline controller to control fediverse content

This commit is contained in:
2026-01-01 00:10:00 +08:00
parent 3c83fdfc4d
commit 42b46243a4
2 changed files with 16 additions and 10 deletions

View File

@@ -25,7 +25,8 @@ public class ActivityController(TimelineService acts) : ControllerBase
public async Task<ActionResult<List<SnTimelineEvent>>> ListEvents(
[FromQuery] string? cursor,
[FromQuery] string? filter,
[FromQuery] int take = 20
[FromQuery] int take = 20,
[FromQuery] bool showFediverse = false
)
{
Instant? cursorTimestamp = null;
@@ -43,7 +44,7 @@ public class ActivityController(TimelineService acts) : ControllerBase
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
return currentUserValue is not Account currentUser
? Ok(await acts.ListEventsForAnyone(take, cursorTimestamp))
: Ok(await acts.ListEvents(take, cursorTimestamp, currentUser, filter));
? Ok(await acts.ListEventsForAnyone(take, cursorTimestamp, showFediverse))
: Ok(await acts.ListEvents(take, cursorTimestamp, currentUser, filter, showFediverse));
}
}