Browse Source

Fix thread-unsafe ActivityPub activity dispatch (#37423)

pull/1371/head
Joshua Rogers 2 months ago committed by Misty De Meo
parent
commit
0e9867f201
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C
  1. 7
      app/lib/activitypub/activity.rb

7
app/lib/activitypub/activity.rb

@ -21,14 +21,13 @@ class ActivityPub::Activity
class << self class << self
def factory(json, account, **) def factory(json, account, **)
@json = json klass_for(json)&.new(json, account, **)
klass&.new(json, account, **)
end end
private private
def klass def klass_for(json)
case @json['type'] case json['type']
when 'Create' when 'Create'
ActivityPub::Activity::Create ActivityPub::Activity::Create
when 'Announce' when 'Announce'

Loading…
Cancel
Save