import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.util.*
+import kotlinx.coroutines.flow.filterNot
import kotlinx.coroutines.flow.take
import kotlinx.coroutines.flow.toList
import kotlinx.html.*
import org.litote.kmongo.descending
-import java.lang.NullPointerException
import java.time.Instant
suspend fun ApplicationCall.recentCommentsPage(): HTML.() -> Unit {
val comments = CommentRenderData(
Comment.Table
.sorted(descending(Comment::submittedAt))
+ .filterNot { comment ->
+ NationData.get(comment.submittedBy).isBanned
+ }
.take(limit)
.toList(),
nationCache