2
0

Always give local quote of remote posts a quote request URI (#35383)

This commit is contained in:
Claire
2025-07-15 15:01:03 +02:00
committed by David Roetzel
parent 7ae78b1032
commit ee83f3a8b9
2 changed files with 6 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ class Quote < ApplicationRecord
belongs_to :quoted_account, class_name: 'Account', optional: true
before_validation :set_accounts
before_validation :set_activity_uri, only: :create, if: -> { account.local? && quoted_account&.remote? }
validates :activity_uri, presence: true, if: -> { account.local? && quoted_account&.remote? }
validate :validate_visibility
@@ -69,4 +69,8 @@ class Quote < ApplicationRecord
errors.add(:quoted_status_id, :visibility_mismatch)
end
def set_activity_uri
self.activity_uri = [ActivityPub::TagManager.instance.uri_for(account), '/quote_requests/', SecureRandom.uuid].join
end
end