Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/services/activitypub/fetch_remote_poll_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class ActivityPub::FetchRemotePollService < BaseService

def call(poll, on_behalf_of = nil)
json = fetch_resource(poll.status.uri, true, on_behalf_of)
return unless supported_context?(json)
ActivityPub::ProcessPollService.new.call(poll, json)
end
end
6 changes: 1 addition & 5 deletions app/services/activitypub/process_poll_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ActivityPub::ProcessPollService < BaseService

def call(poll, json)
@json = json
return unless supported_context? && expected_type?
return unless expected_type?

previous_expires_at = poll.expires_at

Expand Down Expand Up @@ -54,10 +54,6 @@ def call(poll, json)

private

def supported_context?
super(@json)
end

def expected_type?
equals_or_includes_any?(@json['type'], %w(Question))
end
Expand Down