X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FIndexPage.kt;h=5e3f9050574d9779a9b56d7685fde00ade2d19f6;hb=6ddb4dad913e7b06a5ac5f33f73bf8214049bd8e;hp=fb67bbacc09618a8493409f1c85580e16324b8a8;hpb=a76956e389fcfe6282ad4ca7156bbf76327bb0c0;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt index fb67bba..5e3f905 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt @@ -15,8 +15,9 @@ import javax.inject.* */ @MenuName("Index") @TemplatePath("/templates/index.html") +@ToadletPath("index.html") class IndexPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer, private val postVisibilityFilter: PostVisibilityFilter) : - LoggedInPage("index.html", "Page.Index.Title", webInterface, loaders, templateRenderer) { + LoggedInPage("Page.Index.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { (currentSone.posts + @@ -25,7 +26,7 @@ class IndexPage @Inject constructor(webInterface: WebInterface, loaders: Loaders .flatMap { it.posts } + soneRequest.core.getDirectedPosts(currentSone.id) ).distinct() - .filter { postVisibilityFilter.isVisible(currentSone).apply(it) } + .filter { postVisibilityFilter.isVisible(currentSone).test(it) } .sortedByDescending { it.time } .let { posts -> posts.paginate(soneRequest.core.preferences.postsPerPage)