Fix thread-unsafe ActivityPub activity dispatch (#37423)
This commit is contained in:
parent
f97a015cf9
commit
48ce49260d
@ -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…
x
Reference in New Issue
Block a user