projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add test for DI constructability of DismissNotificationAjaxPage
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
GetStatusAjaxPage.kt
diff --git
a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt
b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt
index
e2642c9
..
7646704
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt
@@
-36,7
+36,7
@@
class GetStatusAjaxPage(webInterface: WebInterface, private val elementLoader: E
this["loggedIn"] = currentSone != null
this["options"] = currentSone?.options?.toJsonOptions() ?: jsonObject {}
this["notificationHash"] = webInterface.getNotifications(currentSone).sortedBy { it.createdTime }.hashCode()
this["loggedIn"] = currentSone != null
this["options"] = currentSone?.options?.toJsonOptions() ?: jsonObject {}
this["notificationHash"] = webInterface.getNotifications(currentSone).sortedBy { it.createdTime }.hashCode()
- this["sones"] = request.httpRequest.getParam("soneIds").split(',').map
Present
(core::getSone).plus(currentSone).filterNotNull().toJsonSones()
+ this["sones"] = request.httpRequest.getParam("soneIds").split(',').map
NotNull
(core::getSone).plus(currentSone).filterNotNull().toJsonSones()
this["newPosts"] = webInterface.getNewPosts(currentSone).toJsonPosts()
this["newReplies"] = webInterface.getNewReplies(currentSone).toJsonReplies()
this["linkedElements"] = request.httpRequest.getParam("elements", "[]").asJson().map(JsonNode::asText).map(elementLoader::loadElement).toJsonElements()
this["newPosts"] = webInterface.getNewPosts(currentSone).toJsonPosts()
this["newReplies"] = webInterface.getNewReplies(currentSone).toJsonReplies()
this["linkedElements"] = request.httpRequest.getParam("elements", "[]").asJson().map(JsonNode::asText).map(elementLoader::loadElement).toJsonElements()
@@
-49,8
+49,8
@@
class GetStatusAjaxPage(webInterface: WebInterface, private val elementLoader: E
private fun String.asJson() = ObjectMapper().readTree(this).asIterable()
private fun String.asJson() = ObjectMapper().readTree(this).asIterable()
- override
fun needsFormPassword()
= false
- override
fun requiresLogin()
= false
+ override
val needsFormPassword
= false
+ override
val requiresLogin
= false
private fun SoneOptions.toJsonOptions() = jsonObject {
put("ShowNotification/NewSones", isShowNewSoneNotifications)
private fun SoneOptions.toJsonOptions() = jsonObject {
put("ShowNotification/NewSones", isShowNewSoneNotifications)
@@
-64,8
+64,8
@@
class GetStatusAjaxPage(webInterface: WebInterface, private val elementLoader: E
put("name", SoneAccessor.getNiceName(sone))
put("local", sone.isLocal)
put("status", sone.status.name)
put("name", SoneAccessor.getNiceName(sone))
put("local", sone.isLocal)
put("status", sone.status.name)
- put("modified",
webInterface.
core.isModifiedSone(sone))
- put("locked",
webInterface.
core.isLocked(sone))
+ put("modified", core.isModifiedSone(sone))
+ put("locked", core.isLocked(sone))
put("lastUpdatedUnknown", sone.time == 0L)
synchronized(dateFormatter) {
put("lastUpdated", dateFormatter.format(sone.time))
put("lastUpdatedUnknown", sone.time == 0L)
synchronized(dateFormatter) {
put("lastUpdated", dateFormatter.format(sone.time))