diff options
author | ThibG <thib@sitedethib.com> | 2020-11-09 11:30:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 11:30:28 +0100 |
commit | 67125534bc0fd48a45d6cb17a5c78712d8e87150 (patch) | |
tree | b718c8b54a0bd63eab69abaef2267c8f0aa9a9b9 /app/services/activitypub/process_collection_service.rb | |
parent | cfb16b9b70a50ec5451c9aebb2c35d3a44701311 (diff) | |
parent | ecd83f495c18486bc7ea901423f6fccfd910b277 (diff) |
Merge pull request #1454 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/activitypub/process_collection_service.rb')
-rw-r--r-- | app/services/activitypub/process_collection_service.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/activitypub/process_collection_service.rb b/app/services/activitypub/process_collection_service.rb index e6ccaccc9..f1d175dac 100644 --- a/app/services/activitypub/process_collection_service.rb +++ b/app/services/activitypub/process_collection_service.rb @@ -8,7 +8,7 @@ class ActivityPub::ProcessCollectionService < BaseService @json = Oj.load(body, mode: :strict) @options = options - return if !supported_context? || (different_actor? && verify_account!.nil?) || @account.suspended? || @account.local? + return if !supported_context? || (different_actor? && verify_account!.nil?) || suspended_actor? || @account.local? case @json['type'] when 'Collection', 'CollectionPage' @@ -28,6 +28,14 @@ class ActivityPub::ProcessCollectionService < BaseService @json['actor'].present? && value_or_id(@json['actor']) != @account.uri end + def suspended_actor? + @account.suspended? && !activity_allowed_while_suspended? + end + + def activity_allowed_while_suspended? + %w(Delete Reject Undo Update).include?(@json['type']) + end + def process_items(items) items.reverse_each.map { |item| process_item(item) }.compact end |