Add support for reversible suspensions through ActivityPub (#14989)
This commit is contained in:
parent
ee8cf246cf
commit
3134691948
47 changed files with 1049 additions and 204 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue