Merge commit '16c41e035bdd6e08927c950aeeb5332adbe8b6d5' into glitch-soc/merge-upstream
Conflicts: - `lib/mastodon/version.rb`: Upstream bumped the Mastodon API version, glitch-soc has an extra glitch version. Bumped the Mastodon API version as upstream did.
This commit is contained in:
commit
73f77c49d8
138 files changed
+1258
-307
No files matched your search
@@ -38,7 +38,7 @@ class Api::V1::AccountsController < Api::BaseController
|
||||
|
||||
headers.merge!(response.headers)
|
||||
|
||||
self.response_body = Oj.dump(response.body)
|
||||
self.response_body = response.body.to_json
|
||||
self.status = response.status
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
render json: ValidationErrorFormatter.new(e, 'account.username': :username, 'invite_request.text': :reason).as_json, status: 422
|
||||
|
||||
@@ -35,7 +35,7 @@ class Api::V1::DonationCampaignsController < Api::BaseController
|
||||
return if key.blank?
|
||||
|
||||
campaign = Rails.cache.read("donation_campaign:#{key}", raw: true)
|
||||
Oj.load(campaign) if campaign.present?
|
||||
JSON.parse(campaign) if campaign.present?
|
||||
end
|
||||
|
||||
def save_to_cache!(campaign)
|
||||
@@ -44,7 +44,7 @@ class Api::V1::DonationCampaignsController < Api::BaseController
|
||||
Rails.cache.write_multi(
|
||||
{
|
||||
request_key => campaign_key(campaign),
|
||||
"donation_campaign:#{campaign_key(campaign)}" => Oj.dump(campaign),
|
||||
"donation_campaign:#{campaign_key(campaign)}" => campaign.to_json,
|
||||
},
|
||||
expires_in: 1.hour,
|
||||
raw: true
|
||||
@@ -57,7 +57,7 @@ class Api::V1::DonationCampaignsController < Api::BaseController
|
||||
url.query_values = { platform: 'web', seed: seed, locale: locale, environment: Rails.configuration.x.donation_campaigns.environment }.compact
|
||||
|
||||
Request.new(:get, url.to_s).perform do |res|
|
||||
return Oj.load(res.body_with_limit, mode: :strict) if res.code == 200
|
||||
return JSON.parse(res.body_with_limit) if res.code == 200
|
||||
end
|
||||
end
|
||||
rescue *Mastodon::HTTP_CONNECTION_ERRORS, Oj::ParseError
|
||||
|
||||
@@ -25,7 +25,9 @@ class Api::V1::ProfilesController < Api::BaseController
|
||||
:display_name,
|
||||
:note,
|
||||
:avatar,
|
||||
:avatar_description,
|
||||
:header,
|
||||
:header_description,
|
||||
:locked,
|
||||
:bot,
|
||||
:discoverable,
|
||||
|
||||
@@ -30,7 +30,7 @@ class Api::V1::Statuses::PinsController < Api::V1::Statuses::BaseController
|
||||
adapter: ActivityPub::Adapter
|
||||
).as_json
|
||||
|
||||
ActivityPub::RawDistributionWorker.perform_async(Oj.dump(json), current_account.id)
|
||||
ActivityPub::RawDistributionWorker.perform_async(json.to_json, current_account.id)
|
||||
end
|
||||
|
||||
def distribute_remove_activity!
|
||||
@@ -40,6 +40,6 @@ class Api::V1::Statuses::PinsController < Api::V1::Statuses::BaseController
|
||||
adapter: ActivityPub::Adapter
|
||||
).as_json
|
||||
|
||||
ActivityPub::RawDistributionWorker.perform_async(Oj.dump(json), current_account.id)
|
||||
ActivityPub::RawDistributionWorker.perform_async(json.to_json, current_account.id)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user