Merge remote-tracking branch 'origin/master' into gs-master

Conflicts:
 	db/schema.rb
This commit is contained in:
David Yip
2018-04-14 09:12:50 -05:00
18 changed files with 274 additions and 7 deletions

View File

@@ -70,6 +70,7 @@ class ActivityPub::ProcessAccountService < BaseService
@account.display_name = @json['name'] || ''
@account.note = @json['summary'] || ''
@account.locked = @json['manuallyApprovesFollowers'] || false
@account.fields = property_values || {}
end
def set_fetchable_attributes!
@@ -126,6 +127,11 @@ class ActivityPub::ProcessAccountService < BaseService
end
end
def property_values
return unless @json['attachment'].is_a?(Array)
@json['attachment'].select { |attachment| attachment['type'] == 'PropertyValue' }.map { |attachment| attachment.slice('name', 'value') }
end
def mismatching_origin?(url)
needle = Addressable::URI.parse(url).host
haystack = Addressable::URI.parse(@uri).host