Merge tag 'v2.4.5' into kosmos
This commit is contained in:
commit
65beeb044d
2
Gemfile
2
Gemfile
@ -41,7 +41,7 @@ gem 'omniauth-cas', '~> 1.1'
|
|||||||
gem 'omniauth-saml', '~> 1.10'
|
gem 'omniauth-saml', '~> 1.10'
|
||||||
gem 'omniauth', '~> 1.2'
|
gem 'omniauth', '~> 1.2'
|
||||||
|
|
||||||
gem 'doorkeeper', '~> 4.4'
|
gem 'doorkeeper', '~> 5.0'
|
||||||
gem 'fast_blank', '~> 1.0'
|
gem 'fast_blank', '~> 1.0'
|
||||||
gem 'fastimage'
|
gem 'fastimage'
|
||||||
gem 'goldfinger', '~> 2.1'
|
gem 'goldfinger', '~> 2.1'
|
||||||
|
@ -181,7 +181,7 @@ GEM
|
|||||||
docile (1.3.0)
|
docile (1.3.0)
|
||||||
domain_name (0.5.20180417)
|
domain_name (0.5.20180417)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
doorkeeper (4.4.2)
|
doorkeeper (5.0.0)
|
||||||
railties (>= 4.2)
|
railties (>= 4.2)
|
||||||
dotenv (2.2.2)
|
dotenv (2.2.2)
|
||||||
dotenv-rails (2.2.2)
|
dotenv-rails (2.2.2)
|
||||||
@ -670,7 +670,7 @@ DEPENDENCIES
|
|||||||
devise (~> 4.4)
|
devise (~> 4.4)
|
||||||
devise-two-factor (~> 3.0)
|
devise-two-factor (~> 3.0)
|
||||||
devise_pam_authenticatable2 (~> 9.1)
|
devise_pam_authenticatable2 (~> 9.1)
|
||||||
doorkeeper (~> 4.4)
|
doorkeeper (~> 5.0)
|
||||||
dotenv-rails (~> 2.2, < 2.3)
|
dotenv-rails (~> 2.2, < 2.3)
|
||||||
fabrication (~> 2.20)
|
fabrication (~> 2.20)
|
||||||
faker (~> 1.8)
|
faker (~> 1.8)
|
||||||
|
@ -7,14 +7,14 @@ class ActivityPub::FetchRemoteAccountService < BaseService
|
|||||||
|
|
||||||
# Should be called when uri has already been checked for locality
|
# Should be called when uri has already been checked for locality
|
||||||
# Does a WebFinger roundtrip on each call
|
# Does a WebFinger roundtrip on each call
|
||||||
def call(uri, id: true, prefetched_body: nil)
|
def call(uri, id: true, prefetched_body: nil, break_on_redirect: false)
|
||||||
@json = if prefetched_body.nil?
|
@json = if prefetched_body.nil?
|
||||||
fetch_resource(uri, id)
|
fetch_resource(uri, id)
|
||||||
else
|
else
|
||||||
body_to_json(prefetched_body, compare_id: id ? uri : nil)
|
body_to_json(prefetched_body, compare_id: id ? uri : nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
return unless supported_context? && expected_type?
|
return if !supported_context? || !expected_type? || (break_on_redirect && @json['movedTo'].present?)
|
||||||
|
|
||||||
@uri = @json['id']
|
@uri = @json['id']
|
||||||
@username = @json['preferredUsername']
|
@username = @json['preferredUsername']
|
||||||
|
@ -175,7 +175,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||||||
|
|
||||||
def moved_account
|
def moved_account
|
||||||
account = ActivityPub::TagManager.instance.uri_to_resource(@json['movedTo'], Account)
|
account = ActivityPub::TagManager.instance.uri_to_resource(@json['movedTo'], Account)
|
||||||
account ||= ActivityPub::FetchRemoteAccountService.new.call(@json['movedTo'], id: true)
|
account ||= ActivityPub::FetchRemoteAccountService.new.call(@json['movedTo'], id: true, break_on_redirect: true)
|
||||||
account
|
account
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecor
|
|||||||
|
|
||||||
def change
|
def change
|
||||||
safety_assured do
|
safety_assured do
|
||||||
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_exists?(:statuses, name: "index_statuses_20180106")
|
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, "index_statuses_20180106")
|
||||||
end
|
end
|
||||||
|
|
||||||
# These index may not exists (see migration 20180514130000)
|
# These index may not exists (see migration 20180514130000)
|
||||||
|
@ -1,4 +1,17 @@
|
|||||||
class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
|
class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
|
||||||
|
class Account < ApplicationRecord
|
||||||
|
# Dummy class, to make migration possible across version changes
|
||||||
|
has_one :user, inverse_of: :account
|
||||||
|
|
||||||
|
def local?
|
||||||
|
domain.nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
def acct
|
||||||
|
local? ? username : "#{username}@#{domain}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
disable_ddl_transaction!
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
@ -13,7 +13,7 @@ module Mastodon
|
|||||||
end
|
end
|
||||||
|
|
||||||
def patch
|
def patch
|
||||||
4
|
5
|
||||||
end
|
end
|
||||||
|
|
||||||
def pre
|
def pre
|
||||||
|
Loading…
x
Reference in New Issue
Block a user