Skip to content

Commit eb5e65a

Browse files
committed
Fix test
1 parent 2636f26 commit eb5e65a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/models/quote.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ class Quote < ApplicationRecord
4545
after_destroy_commit :decrement_counter_caches!
4646
after_update_commit :update_counter_caches!
4747

48-
def accept!(approval_uri: nil)
48+
def accept!(approval_uri: nil, legacy: false)
4949
if approval_uri.present?
5050
update!(state: :accepted, approval_uri:)
51+
elsif legacy
52+
update!(state: :accepted, approval_uri: 'http://kmy.blue/ns#LegacyQuote')
5153
else
5254
update!(state: :accepted)
5355
end

app/services/activitypub/verify_quote_service.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ def call(quote, approval_uri, fetchable_quoted_uri: nil, prefetched_quoted_objec
1515

1616
fetch_quoted_post_if_needed!(fetchable_quoted_uri, prefetched_body: prefetched_quoted_object)
1717

18-
return quote.accept! if Setting.auto_accept_legacy_quotes && (quote.legacy || (legacy_quote_available? && quote.approval_uri == 'http://kmy.blue/ns#LegacyQuote'))
18+
return quote.accept!(legacy: true) if Setting.auto_accept_legacy_quotes && (quote.legacy || (legacy_quote_available? && approval_uri == 'http://kmy.blue/ns#LegacyQuote'))
1919

20-
return if quote.approval_uri == 'http://kmy.blue/ns#LegacyQuote'
2120
return if quote.quoted_account&.local?
2221
return if fast_track_approval! || @approval_uri.blank?
2322

0 commit comments

Comments
 (0)