mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Fix thread-unsafe ActivityPub activity dispatch (#37423)
This commit is contained in:
@@ -22,13 +22,13 @@ class ActivityPub::Activity
|
||||
class << self
|
||||
def factory(json, account, **options)
|
||||
@json = json
|
||||
klass&.new(json, account, **options)
|
||||
klass_for(json)&.new(json, account, **options)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def klass
|
||||
case @json['type']
|
||||
def klass_for(json)
|
||||
case json['type']
|
||||
when 'Create'
|
||||
ActivityPub::Activity::Create
|
||||
when 'Announce'
|
||||
|
||||
Reference in New Issue
Block a user