diff options
author | ThibG <thib@sitedethib.com> | 2019-01-02 20:03:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-02 20:03:32 +0100 |
commit | 0acd51acdc1e670bf57f58671cb8e30743782c63 (patch) | |
tree | f5ff0b5c3b1e8fd94691264f2bc147e5fa233ecb /app/controllers/api/v1/accounts | |
parent | b300948526d967aaf5608c93546ee0d54940c0ef (diff) | |
parent | e77ceb1b29547ed89b4110b3cc3edc9ac325b620 (diff) |
Merge pull request #878 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/api/v1/accounts')
-rw-r--r-- | app/controllers/api/v1/accounts/statuses_controller.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index d3f1197f8..6c2a5c141 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -28,13 +28,11 @@ class Api::V1::Accounts::StatusesController < Api::BaseController def account_statuses statuses = truthy_param?(:pinned) ? pinned_scope : permitted_account_statuses - statuses = statuses.paginate_by_id( - limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) - ) + statuses = statuses.paginate_by_id(limit_param(DEFAULT_STATUSES_LIMIT), params_slice(:max_id, :since_id, :min_id)) statuses.merge!(only_media_scope) if truthy_param?(:only_media) statuses.merge!(no_replies_scope) if truthy_param?(:exclude_replies) + statuses.merge!(no_reblogs_scope) if truthy_param?(:exclude_reblogs) statuses end @@ -65,6 +63,10 @@ class Api::V1::Accounts::StatusesController < Api::BaseController Status.without_replies end + def no_reblogs_scope + Status.without_reblogs + end + def pagination_params(core_params) params.slice(:limit, :only_media, :exclude_replies).permit(:limit, :only_media, :exclude_replies).merge(core_params) end |