Handle Remove of an individual collection item (#38170)
This commit is contained in:
1 parent
420136e83b
commit
eeed483518
2 files changed
+32
No files matched your search
@@ -14,6 +14,10 @@ class ActivityPub::Activity::Remove < ActivityPub::Activity
|
||||
end
|
||||
when @account.collections_url
|
||||
remove_collection
|
||||
else
|
||||
@collection = @account.collections.find_by(uri: @json['target'])
|
||||
|
||||
remove_collection_item if @collection
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,4 +46,10 @@ class ActivityPub::Activity::Remove < ActivityPub::Activity
|
||||
|
||||
collection&.destroy!
|
||||
end
|
||||
|
||||
def remove_collection_item
|
||||
collection_item = @collection.collection_items.find_by(uri: value_or_id(@object))
|
||||
|
||||
collection_item&.destroy!
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user