X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetTimesAjaxPage.kt;h=96fb7e42cf9f95bce386a0117be92b41f940d949;hp=9310786e51f402cdbb05fcb27eb2f6fccc515f7c;hb=4a74200598acbc920892740918d2d2637c80fd1f;hpb=4af98a3470ba214fb452b0f0d908b707811fa496 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.kt index 9310786..96fb7e4 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.kt @@ -22,13 +22,13 @@ class GetTimesAjaxPage(webInterface: WebInterface, this.timeZone = timeZone } - override fun needsFormPassword() = false - override fun requiresLogin() = false + override val needsFormPassword = false + override val requiresLogin = false override fun createJsonObject(request: FreenetRequest) = createSuccessJsonObject().apply { - put("postTimes", request.parameters["posts"]!!.idsToJson { webInterface.core.getPost(it)?.let { it.id to it.time } }) - put("replyTimes", request.parameters["replies"]!!.idsToJson { webInterface.core.getPostReply(it)?.let { it.id to it.time } }) + put("postTimes", request.parameters["posts"]!!.idsToJson { core.getPost(it).let { it.id to it.time } }) + put("replyTimes", request.parameters["replies"]!!.idsToJson { core.getPostReply(it)?.let { it.id to it.time } }) } private fun String.idsToJson(transform: (String) -> Pair?) = @@ -43,7 +43,7 @@ class GetTimesAjaxPage(webInterface: WebInterface, "tooltip" to synchronized(dateTimeFormatter) { dateTimeFormatter.format(time) }) - }.forEach { this@jsonObject.put(it.first, it.second) } + }.forEach { this@jsonObject.set(it.first, it.second) } } }