diff --git a/docs/openapi.yaml b/docs/openapi.yaml index eb2c890..3792e8d 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -199,6 +199,13 @@ paths: summary: Posts created by the given actor. parameters: - $ref: '#/components/parameters/account_id' + - name: exclude_replies + in: query + description: Exclude replies from results. + required: false + schema: + type: boolean + default: true - name: max_id in: query description: Return results older than this ID. diff --git a/src/mastodon_api/accounts/types.rs b/src/mastodon_api/accounts/types.rs index e18d593..d5fee6e 100644 --- a/src/mastodon_api/accounts/types.rs +++ b/src/mastodon_api/accounts/types.rs @@ -282,8 +282,13 @@ pub struct FollowData { fn default_page_size() -> i64 { 20 } +fn default_exclude_replies() -> bool { true } + #[derive(Deserialize)] pub struct StatusListQueryParams { + #[serde(default = "default_exclude_replies")] + pub exclude_replies: bool, + #[serde(default)] pub pinned: bool, diff --git a/src/mastodon_api/accounts/views.rs b/src/mastodon_api/accounts/views.rs index 2dd46d4..95f182a 100644 --- a/src/mastodon_api/accounts/views.rs +++ b/src/mastodon_api/accounts/views.rs @@ -430,7 +430,7 @@ async fn get_account_statuses( db_client, &profile.id, maybe_current_user.as_ref().map(|user| &user.id), - false, + !query_params.exclude_replies, true, query_params.max_id, query_params.limit,