Handle Reject of a FeatureRequest (#38256)

This commit is contained in:
David Roetzel authored and GitHub committed 2026-03-17 15:59:51 +00:00
1 parent 90840b3ede
commit f3035a8e51
4 files changed
+35 -9

No files matched your search

+6
View File
@@ -167,6 +167,12 @@ class ActivityPub::Activity
@follow_from_object ||= ::Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil?
end
def feature_request_from_object
return @collection_item if instance_variable_defined?(:@collection_item)
@collection_item = CollectionItem.local.find_by(activity_uri: value_or_id(@object), account_id: @account.id)
end
def fetch_remote_original_status
if object_uri.start_with?('http')
return if ActivityPub::TagManager.instance.local_uri?(object_uri)
-6
View File
@@ -84,10 +84,4 @@ class ActivityPub::Activity::Accept < ActivityPub::Activity
def target_uri
@target_uri ||= value_or_id(@object['actor'])
end
def feature_request_from_object
return @collection_item if instance_variable_defined?(:@collection_item)
@collection_item = CollectionItem.local.find_by(activity_uri: value_or_id(@object), account_id: @account.id)
end
end
+8
View File
@@ -6,6 +6,7 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity
return follow_request_from_object.reject! unless follow_request_from_object.nil?
return UnfollowService.new.call(follow_from_object.account, @account) unless follow_from_object.nil?
return reject_quote!(quote_request_from_object) unless quote_request_from_object.nil?
return reject_feature_request! unless feature_request_from_object.nil?
case @object['type']
when 'Follow'
@@ -46,6 +47,13 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity
quote.reject!
end
def reject_feature_request!
collection_item = feature_request_from_object
return unless collection_item.account == @account && collection_item.local?
collection_item.destroy!
end
def relay
@relay ||= Relay.find_by(follow_activity_id: object_uri) unless object_uri.nil?
end