Fix handling of ActivityPub activities lacking some attributes (#8864)
This commit is contained in:
parent
3b6ab82db7
commit
ba444797d2
@ -26,7 +26,7 @@ class ActivityPub::Activity::Accept < ActivityPub::Activity
|
||||
end
|
||||
|
||||
def relay
|
||||
@relay ||= Relay.find_by(follow_activity_id: object_uri)
|
||||
@relay ||= Relay.find_by(follow_activity_id: object_uri) unless object_uri.nil?
|
||||
end
|
||||
|
||||
def relay_follow?
|
||||
|
@ -17,6 +17,8 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
|
||||
end
|
||||
|
||||
def delete_note
|
||||
return if object_uri.nil?
|
||||
|
||||
@status = Status.find_by(uri: object_uri, account: @account)
|
||||
@status ||= Status.find_by(uri: @object['atomUri'], account: @account) if @object.is_a?(Hash) && @object['atomUri'].present?
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity
|
||||
end
|
||||
|
||||
def relay
|
||||
@relay ||= Relay.find_by(follow_activity_id: object_uri)
|
||||
@relay ||= Relay.find_by(follow_activity_id: object_uri) unless object_uri.nil?
|
||||
end
|
||||
|
||||
def relay_follow?
|
||||
|
@ -19,6 +19,8 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity
|
||||
private
|
||||
|
||||
def undo_announce
|
||||
return if object_uri.nil?
|
||||
|
||||
status = Status.find_by(uri: object_uri, account: @account)
|
||||
status ||= Status.find_by(uri: @object['atomUri'], account: @account) if @object.is_a?(Hash) && @object['atomUri'].present?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user