Merge commit 'b48f907b20e2c9909665a484041845697d26f17c' into glitch-soc/merge-upstream
Conflicts: - `app/helpers/settings_helper.rb`: Upstream added a new helper. Conflict caused by the fact there is a glitch-soc specific helper. Added upstream's new helper in addition to glitch-soc's.
This commit is contained in:
commit
e08c8b6933
268 files changed
+2079
-396
No files matched your search
@@ -100,4 +100,8 @@ class Api::BaseController < ApplicationController
|
||||
def respond_with_error(code)
|
||||
render json: { error: Rack::Utils::HTTP_STATUS_CODES[code] }, status: code
|
||||
end
|
||||
|
||||
def alpha_path?
|
||||
request.path.starts_with?('/api/v1_alpha')
|
||||
end
|
||||
end
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
class Api::V1::CollectionItemsController < Api::BaseController
|
||||
include Authorization
|
||||
include DeprecationConcern
|
||||
|
||||
deprecate_api '2026-06-10', if: :alpha_path?
|
||||
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:collections' }
|
||||
|
||||
|
||||
@@ -2,13 +2,17 @@
|
||||
|
||||
class Api::V1::CollectionsController < Api::BaseController
|
||||
include Authorization
|
||||
include DeprecationConcern
|
||||
|
||||
DEFAULT_COLLECTIONS_LIMIT = 40
|
||||
MAX_COLLECTIONS_LIMIT = 100
|
||||
|
||||
rescue_from ActiveRecord::RecordInvalid, Mastodon::ValidationError do |e|
|
||||
render json: { error: ValidationErrorFormatter.new(e).as_json }, status: 422
|
||||
end
|
||||
|
||||
deprecate_api '2026-06-10', if: :alpha_path?
|
||||
|
||||
before_action -> { authorize_if_got_token! :read, :'read:collections' }, only: [:index, :show]
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:collections' }, only: [:create, :update, :destroy]
|
||||
|
||||
@@ -73,7 +77,7 @@ class Api::V1::CollectionsController < Api::BaseController
|
||||
.with_tag
|
||||
.order(created_at: :desc)
|
||||
.offset(offset_param)
|
||||
.limit(limit_param(DEFAULT_COLLECTIONS_LIMIT))
|
||||
.limit(limit_param(DEFAULT_COLLECTIONS_LIMIT, MAX_COLLECTIONS_LIMIT))
|
||||
@collections = @collections.discoverable unless @account == current_account
|
||||
end
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ class Api::V1::Notifications::PoliciesController < Api::BaseController
|
||||
:filter_not_following,
|
||||
:filter_not_followers,
|
||||
:filter_new_accounts,
|
||||
:filter_private_mentions
|
||||
:filter_private_mentions,
|
||||
:filter_bots
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -32,7 +32,8 @@ class Api::V2::Notifications::PoliciesController < Api::BaseController
|
||||
:for_not_followers,
|
||||
:for_new_accounts,
|
||||
:for_private_mentions,
|
||||
:for_limited_accounts
|
||||
:for_limited_accounts,
|
||||
:for_bots
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user