Remove inbound_quotes feature flag (#34958)
				
					
				
			This commit is contained in:
		@@ -226,8 +226,6 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def process_quote
 | 
					  def process_quote
 | 
				
			||||||
    return unless Mastodon::Feature.inbound_quotes_enabled?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @quote_uri = @status_parser.quote_uri
 | 
					    @quote_uri = @status_parser.quote_uri
 | 
				
			||||||
    return if @quote_uri.blank?
 | 
					    return if @quote_uri.blank?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,6 @@ class ActivityPub::Activity::QuoteRequest < ActivityPub::Activity
 | 
				
			|||||||
  include Payloadable
 | 
					  include Payloadable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def perform
 | 
					  def perform
 | 
				
			||||||
    return unless Mastodon::Feature.inbound_quotes_enabled?
 | 
					 | 
				
			||||||
    return if non_matching_uri_hosts?(@account.uri, @json['id'])
 | 
					    return if non_matching_uri_hosts?(@account.uri, @json['id'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    quoted_status = status_from_uri(object_uri)
 | 
					    quoted_status = status_from_uri(object_uri)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -271,8 +271,6 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def update_quote!
 | 
					  def update_quote!
 | 
				
			||||||
    return unless Mastodon::Feature.inbound_quotes_enabled?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    quote_uri = @status_parser.quote_uri
 | 
					    quote_uri = @status_parser.quote_uri
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if quote_uri.present?
 | 
					    if quote_uri.present?
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -887,7 +887,7 @@ RSpec.describe ActivityPub::Activity::Create do
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      context 'with an unverifiable quote of a known post', feature: :inbound_quotes do
 | 
					      context 'with an unverifiable quote of a known post' do
 | 
				
			||||||
        let(:quoted_status) { Fabricate(:status) }
 | 
					        let(:quoted_status) { Fabricate(:status) }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let(:object_json) do
 | 
					        let(:object_json) do
 | 
				
			||||||
@@ -911,7 +911,7 @@ RSpec.describe ActivityPub::Activity::Create do
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      context 'with an unverifiable unknown post', feature: :inbound_quotes do
 | 
					      context 'with an unverifiable unknown post' do
 | 
				
			||||||
        let(:unknown_post_uri) { 'https://unavailable.example.com/unavailable-post' }
 | 
					        let(:unknown_post_uri) { 'https://unavailable.example.com/unavailable-post' }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let(:object_json) do
 | 
					        let(:object_json) do
 | 
				
			||||||
@@ -939,7 +939,7 @@ RSpec.describe ActivityPub::Activity::Create do
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      context 'with a verifiable quote of a known post', feature: :inbound_quotes do
 | 
					      context 'with a verifiable quote of a known post' do
 | 
				
			||||||
        let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					        let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
        let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					        let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
        let(:approval_uri) { 'https://quoted.example.com/quote-approval' }
 | 
					        let(:approval_uri) { 'https://quoted.example.com/quote-approval' }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
require 'rails_helper'
 | 
					require 'rails_helper'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RSpec.describe ActivityPub::Activity::QuoteRequest, feature: :inbound_quotes do
 | 
					RSpec.describe ActivityPub::Activity::QuoteRequest do
 | 
				
			||||||
  let(:sender)    { Fabricate(:account, domain: 'example.com') }
 | 
					  let(:sender)    { Fabricate(:account, domain: 'example.com') }
 | 
				
			||||||
  let(:recipient) { Fabricate(:account) }
 | 
					  let(:recipient) { Fabricate(:account) }
 | 
				
			||||||
  let(:quoted_post) { Fabricate(:status, account: recipient) }
 | 
					  let(:quoted_post) { Fabricate(:status, account: recipient) }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -435,7 +435,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status has an existing unverified quote and adds an approval link', feature: :inbound_quotes do
 | 
					  context 'when the status has an existing unverified quote and adds an approval link' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: nil) }
 | 
					    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: nil) }
 | 
				
			||||||
@@ -500,7 +500,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status has an existing verified quote and removes an approval link', feature: :inbound_quotes do
 | 
					  context 'when the status has an existing verified quote and removes an approval link' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: approval_uri, state: :accepted) }
 | 
					    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: approval_uri, state: :accepted) }
 | 
				
			||||||
@@ -535,7 +535,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status adds a verifiable quote', feature: :inbound_quotes do
 | 
					  context 'when the status adds a verifiable quote' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let(:approval_uri) { 'https://quoted.example.com/approvals/1' }
 | 
					    let(:approval_uri) { 'https://quoted.example.com/approvals/1' }
 | 
				
			||||||
@@ -600,7 +600,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status adds a unverifiable quote', feature: :inbound_quotes do
 | 
					  context 'when the status adds a unverifiable quote' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let(:approval_uri) { 'https://quoted.example.com/approvals/1' }
 | 
					    let(:approval_uri) { 'https://quoted.example.com/approvals/1' }
 | 
				
			||||||
@@ -635,7 +635,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status removes a verified quote', feature: :inbound_quotes do
 | 
					  context 'when the status removes a verified quote' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: approval_uri, state: :accepted) }
 | 
					    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: approval_uri, state: :accepted) }
 | 
				
			||||||
@@ -660,7 +660,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status removes an unverified quote', feature: :inbound_quotes do
 | 
					  context 'when the status removes an unverified quote' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: nil, state: :pending) }
 | 
					    let!(:quote) { Fabricate(:quote, status: status, quoted_status: quoted_status, approval_uri: nil, state: :pending) }
 | 
				
			||||||
@@ -684,7 +684,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status swaps a verified quote with an unverifiable quote', feature: :inbound_quotes do
 | 
					  context 'when the status swaps a verified quote with an unverifiable quote' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
    let(:second_quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:second_quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
@@ -752,7 +752,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  context 'when the status swaps a verified quote with another verifiable quote', feature: :inbound_quotes do
 | 
					  context 'when the status swaps a verified quote with another verifiable quote' do
 | 
				
			||||||
    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
					    let(:quoted_account) { Fabricate(:account, domain: 'quoted.example.com') }
 | 
				
			||||||
    let(:second_quoted_account) { Fabricate(:account, domain: 'second-quoted.example.com') }
 | 
					    let(:second_quoted_account) { Fabricate(:account, domain: 'second-quoted.example.com') }
 | 
				
			||||||
    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
					    let(:quoted_status) { Fabricate(:status, account: quoted_account) }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user