style: fix lint (CI)

This commit is contained in:
usbharu 2025-02-25 02:22:07 +00:00 committed by github-actions[bot]
parent 6819c8d847
commit 5e073233da
4 changed files with 14 additions and 8 deletions

View File

@ -18,20 +18,25 @@ class NodeinfoApplicationService(
private val applicationConfig: ApplicationConfig, private val applicationConfig: ApplicationConfig,
transaction: Transaction, transaction: Transaction,
) : AbstractApplicationService<NodeinfoRequest, Nodeinfo2_0>( ) : AbstractApplicationService<NodeinfoRequest, Nodeinfo2_0>(
transaction, logger transaction,
logger
) { ) {
override suspend fun internalExecute(command: NodeinfoRequest, principal: Principal): Nodeinfo2_0 { override suspend fun internalExecute(command: NodeinfoRequest, principal: Principal): Nodeinfo2_0 {
return when (command.version) { return when (command.version) {
"2.0", "2.1" -> Nodeinfo2_0( "2.0", "2.1" -> Nodeinfo2_0(
version = command.version, version = command.version,
software = mapOf( software = mapOf(
"name" to "hideout", "version" to (buildInfo?.version ?: "UNKNOWN") "name" to "hideout",
"version" to (buildInfo?.version ?: "UNKNOWN")
), ),
protocol = listOf("activitypub"), protocol = listOf("activitypub"),
NodeinfoUsage( NodeinfoUsage(
users = mapOf( users = mapOf(
"total" to 0, "activeMonth" to 0, "activeHalfyear" to 0 "total" to 0,
), localPosts = 0 "activeMonth" to 0,
"activeHalfyear" to 0
),
localPosts = 0
), ),
openRegistration = applicationConfig.private.not(), openRegistration = applicationConfig.private.not(),
metadata = mapOf() metadata = mapOf()

View File

@ -19,7 +19,8 @@ class NodeinfoController(
Link( Link(
"http://nodeinfo.diaspora.software/ns/schema/2.1", "http://nodeinfo.diaspora.software/ns/schema/2.1",
href = applicationConfig.url.resolve("/nodeinfo/2.1").toString() href = applicationConfig.url.resolve("/nodeinfo/2.1").toString()
), Link( ),
Link(
"http://nodeinfo.diaspora.software/ns/schema/2.0", "http://nodeinfo.diaspora.software/ns/schema/2.0",
href = applicationConfig.url.resolve("/nodeinfo/2.0").toString() href = applicationConfig.url.resolve("/nodeinfo/2.0").toString()
) )