Compare commits

...

2 Commits

Author SHA1 Message Date
Claire
4934a03102
Merge 77e587129a into 94bceb8683 2025-07-11 14:03:35 +00:00
Claire
77e587129a Fix verified links being re-checked on all profile fetches
Fixes #27755
2023-11-07 11:44:59 +01:00
2 changed files with 13 additions and 1 deletions

View File

@ -304,6 +304,18 @@ class Account < ApplicationRecord
end
end
def fields=(fields)
old_fields = self[:fields] || []
old_fields = [] if old_fields.is_a?(Hash)
self[:fields] = fields.map do |field|
verified_at = old_fields.find { |item| item['value'] == field['value'] }&.fetch('verified_at', nil)
next field if verified_at.blank?
field.merge('verified_at' => verified_at)
end
end
def fields_attributes=(attributes)
fields = []
old_fields = self[:fields] || []

View File

@ -251,7 +251,7 @@ class ActivityPub::ProcessAccountService < BaseService
def property_values
return unless @json['attachment'].is_a?(Array)
as_array(@json['attachment']).select { |attachment| attachment['type'] == 'PropertyValue' }.map { |attachment| attachment.slice('name', 'value') }
as_array(@json['attachment']).filter_map { |attachment| attachment.slice('name', 'value') if attachment['type'] == 'PropertyValue' }
end
def mismatching_origin?(url)