X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FSearchPage.kt;fp=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FSearchPage.kt;h=e94d8798aba8f4e8727f34a74ca092e9e5125dcf;hp=7cddc3588983a7e9f4f7f63c10323783149f2893;hb=f006d66e2b479a97fe476c1eb9cad5b6421f60aa;hpb=6d51a9996446ad0c1cbf5c36eb2802c35876c18e diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt index 7cddc35..e94d879 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt @@ -22,14 +22,18 @@ import net.pterodactylus.util.template.TemplateContext import net.pterodactylus.util.text.StringEscaper import net.pterodactylus.util.text.TextException import java.util.concurrent.TimeUnit.MINUTES +import javax.inject.Inject /** * This page lets the user search for posts and replies that contain certain * words. */ -class SearchPage @JvmOverloads constructor(template: Template, webInterface: WebInterface, ticker: Ticker = Ticker.systemTicker()): +class SearchPage(template: Template, webInterface: WebInterface, ticker: Ticker = Ticker.systemTicker()) : SoneTemplatePage("search.html", webInterface, template, "Page.Search.Title") { + @Inject constructor(template: Template, webInterface: WebInterface) : + this(template, webInterface, Ticker.systemTicker()) + private val cache: Cache, Pagination> = CacheBuilder.newBuilder().ticker(ticker).expireAfterAccess(5, MINUTES).build() override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {