diff options
author | David Yip <yipdw@member.fsf.org> | 2018-05-04 14:16:30 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-05-04 14:16:30 -0500 |
commit | 7600067a300b650a6f30da19a469c913243f3a13 (patch) | |
tree | 8b84acffba4bd167b8e7c6d332c48013b68e7079 /app/lib | |
parent | cb62935c0b00f41ff5d4ab77a8cc38174b05d186 (diff) | |
parent | 6793bec4c67e695100cb4d8551f0bda0b7e87b12 (diff) |
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
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activitypub/activity/block.rb | 2 | ||||
-rw-r--r-- | app/lib/activitypub/activity/follow.rb | 2 | ||||
-rw-r--r-- | app/lib/activitypub/tag_manager.rb | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/app/lib/activitypub/activity/block.rb b/app/lib/activitypub/activity/block.rb index f630d5db2..26da8bdf5 100644 --- a/app/lib/activitypub/activity/block.rb +++ b/app/lib/activitypub/activity/block.rb @@ -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 diff --git a/app/lib/activitypub/activity/follow.rb b/app/lib/activitypub/activity/follow.rb index 8adbbb9c3..fbbf358a8 100644 --- a/app/lib/activitypub/activity/follow.rb +++ b/app/lib/activitypub/activity/follow.rb @@ -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) diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index fa2a8f7d3..908ea9639 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -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? |