feat: FollowとAcceptのclassを追加

This commit is contained in:
usbharu 2023-03-30 17:42:05 +09:00
parent 00fd7f4624
commit 61ddbb5743
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,16 @@
package dev.usbharu.hideout.ap
open class Accept : Object {
public var `object`:Object? = null
public var actor:String? = null
protected constructor() : super()
constructor(
type: List<String> = emptyList(),
name: String,
`object`: Object?,
actor: String?
) : super(add(type,"Accept"), name) {
this.`object` = `object`
this.actor = actor
}
}

View File

@ -0,0 +1,16 @@
package dev.usbharu.hideout.ap
open class Follow : Object{
public var `object`:Object? = null
public var actor:String? = null
protected constructor() : super()
constructor(
type: List<String> = emptyList(),
name: String,
`object`: Object?,
actor: String?
) : super(add(type,"Follow"), name) {
this.`object` = `object`
this.actor = actor
}
}

View File

@ -15,7 +15,7 @@ class ActivityPubService() {
return when(typeAsText){
"Follow" -> ActivityType.Follow
"Undo" -> ActivityType.Undo
else -> throw IllegalArgumentException()
else -> throw IllegalArgumentException(typeAsText)
}
}
}