|
|
|
@ -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' |
|
|
|
|