🔀 Merge branch 'release/v82'
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / ajax / GetNotificationsAjaxPage.kt
index db6e5c5..c60fe56 100644 (file)
@@ -3,8 +3,7 @@ package net.pterodactylus.sone.web.ajax
 import net.pterodactylus.sone.data.Sone
 import net.pterodactylus.sone.data.SoneOptions
 import net.pterodactylus.sone.main.SonePlugin
-import net.pterodactylus.sone.utils.jsonArray
-import net.pterodactylus.sone.utils.jsonObject
+import net.pterodactylus.sone.utils.*
 import net.pterodactylus.sone.web.WebInterface
 import net.pterodactylus.sone.web.page.*
 import net.pterodactylus.util.notify.Notification
@@ -22,7 +21,7 @@ class GetNotificationsAjaxPage @Inject constructor(webInterface: WebInterface) :
        override val requiresLogin = false
 
        override fun createJsonObject(request: FreenetRequest) =
-                       getCurrentSone(request.toadletContext, false).let { currentSone ->
+                       getCurrentSone(request.toadletContext).let { currentSone ->
                                webInterface.getNotifications(currentSone)
                                                .sortedBy(Notification::getCreatedTime)
                                                .let { notifications ->
@@ -74,5 +73,3 @@ private val SoneOptions?.asJsonObject
                                "ShowNotification/NewReplies" to options.isShowNewReplyNotifications
                )
        } ?: jsonObject {}
-
-private fun Notification.render() = StringWriter().use { it.also { render(it) } }.toString()