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

Conflicts:
 	app/controllers/follower_accounts_controller.rb
 	app/controllers/following_accounts_controller.rb
    	db/schema.rb
This commit is contained in:
David Yip
2018-05-04 14:16:30 -05:00
13 changed files with 96 additions and 40 deletions

View File

@@ -7,6 +7,6 @@ class ActivityPub::Activity::Block < ActivityPub::Activity
return if target_account.nil? || !target_account.local? || delete_arrived_first?(@json['id']) || @account.blocking?(target_account)
UnfollowService.new.call(target_account, @account) if target_account.following?(@account)
@account.block!(target_account)
@account.block!(target_account, uri: @json['id'])
end
end

View File

@@ -12,7 +12,7 @@ class ActivityPub::Activity::Follow < ActivityPub::Activity
return
end
follow_request = FollowRequest.create!(account: @account, target_account: target_account)
follow_request = FollowRequest.create!(account: @account, target_account: target_account, uri: @json['id'])
if target_account.locked?
NotifyService.new.call(target_account, follow_request)

View File

@@ -38,6 +38,10 @@ class ActivityPub::TagManager
end
end
def generate_uri_for(_target)
URI.join(root_url, 'payloads', SecureRandom.uuid)
end
def activity_uri_for(target)
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?