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
def factory(json, account, **)
@json = json
klass&.new(json, account, **)
klass_for(json)&.new(json, account, **)
end
private
def klass
case @json['type']
def klass_for(json)
case json['type']
when 'Create'
ActivityPub::Activity::Create
when 'Announce'

Loading…
Cancel
Save