mirror of https://github.com/usbharu/Hideout.git
fix: 間違えてNoteを直接送りつけていたのでCreateを送りつけるように
This commit is contained in:
parent
3e81eb78f7
commit
dcbfe96f0d
|
@ -0,0 +1,30 @@
|
|||
package dev.usbharu.hideout.domain.model.ap
|
||||
|
||||
open class Create : Object {
|
||||
var `object` : Object? = null
|
||||
|
||||
protected constructor() : super()
|
||||
constructor(type: List<String> = emptyList(), name: String, `object`: Object?) : super(add(type,"Create"), name) {
|
||||
this.`object` = `object`
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (other !is Create) return false
|
||||
if (!super.equals(other)) return false
|
||||
|
||||
return `object` == other.`object`
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = super.hashCode()
|
||||
result = 31 * result + (`object`?.hashCode() ?: 0)
|
||||
return result
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Create(`object`=$`object`) ${super.toString()}"
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package dev.usbharu.hideout.service.activitypub
|
|||
import com.fasterxml.jackson.module.kotlin.readValue
|
||||
import dev.usbharu.hideout.config.Config
|
||||
import dev.usbharu.hideout.domain.model.PostEntity
|
||||
import dev.usbharu.hideout.domain.model.ap.Create
|
||||
import dev.usbharu.hideout.domain.model.ap.Note
|
||||
import dev.usbharu.hideout.domain.model.job.DeliverPostJob
|
||||
import dev.usbharu.hideout.plugins.postAp
|
||||
|
@ -51,7 +52,10 @@ class ActivityPubNoteServiceImpl(
|
|||
httpClient.postAp(
|
||||
urlString = inbox,
|
||||
username = "$actor#pubkey",
|
||||
jsonLd = note
|
||||
jsonLd = Create(
|
||||
name = "Create Note",
|
||||
`object` = note
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue