mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Fix thread-unsafe ActivityPub activity dispatch (#37423)
This commit is contained in:
parent
deeaf50472
commit
0cda068918
1 changed files with 3 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue