X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FPostAccessor.kt;h=ab7f6ba537efaae223fe44b5b0d7822e806f88a3;hb=HEAD;hp=843e6e39acdc71dd9afa9c546212aad0ab77d645;hpb=f98ec5222b0611a7e473c01cb6ef3a4ef73bc294;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/template/PostAccessor.kt b/src/main/kotlin/net/pterodactylus/sone/template/PostAccessor.kt index 843e6e3..42239aa 100644 --- a/src/main/kotlin/net/pterodactylus/sone/template/PostAccessor.kt +++ b/src/main/kotlin/net/pterodactylus/sone/template/PostAccessor.kt @@ -1,5 +1,5 @@ /* - * Sone - PostAccessor.java - Copyright © 2010–2019 David Roden + * Sone - PostAccessor.kt - Copyright © 2010–2020 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package net.pterodactylus.sone.template import net.pterodactylus.sone.core.* @@ -50,5 +51,5 @@ class PostAccessor(private val core: Core) : ReflectionAccessor() { } -private fun Core.getReplies(post: Post) = getReplies(post.id).filter { Reply.FUTURE_REPLY_FILTER.apply(it) } +private fun Core.getReplies(post: Post) = getReplies(post.id).filter(noFutureReply) private val TemplateContext?.currentSone: Sone? get() = this?.get("currentSone") as? Sone