Skip to content

Commit 55c986d

Browse files
ClearlyClaireGargron
authored andcommitted
Fix processing poll Updates (mastodon#10333)
ActivityPub::ProcessPollService was checking the JSON-LD context although it was passed only the `Question` object embedded in the `Update` activity.
1 parent 3bea0ca commit 55c986d

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

app/services/activitypub/fetch_remote_poll_service.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class ActivityPub::FetchRemotePollService < BaseService
55

66
def call(poll, on_behalf_of = nil)
77
json = fetch_resource(poll.status.uri, true, on_behalf_of)
8+
return unless supported_context?(json)
89
ActivityPub::ProcessPollService.new.call(poll, json)
910
end
1011
end

app/services/activitypub/process_poll_service.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class ActivityPub::ProcessPollService < BaseService
55

66
def call(poll, json)
77
@json = json
8-
return unless supported_context? && expected_type?
8+
return unless expected_type?
99

1010
previous_expires_at = poll.expires_at
1111

@@ -54,10 +54,6 @@ def call(poll, json)
5454

5555
private
5656

57-
def supported_context?
58-
super(@json)
59-
end
60-
6157
def expected_type?
6258
equals_or_includes_any?(@json['type'], %w(Question))
6359
end

0 commit comments

Comments
 (0)