mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-12 15:33:14 +00:00
Compare commits
2 Commits
dc008244be
...
4934a03102
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4934a03102 | ||
![]() |
77e587129a |
|
@ -304,6 +304,18 @@ class Account < ApplicationRecord
|
||||||
end
|
end
|
||||||
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)
|
def fields_attributes=(attributes)
|
||||||
fields = []
|
fields = []
|
||||||
old_fields = self[:fields] || []
|
old_fields = self[:fields] || []
|
||||||
|
|
|
@ -251,7 +251,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||||
def property_values
|
def property_values
|
||||||
return unless @json['attachment'].is_a?(Array)
|
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
|
end
|
||||||
|
|
||||||
def mismatching_origin?(url)
|
def mismatching_origin?(url)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user