import com.mongodb.client.model.Sorts
import info.mechyrdia.Configuration
+import info.mechyrdia.OwnerNationId
import info.mechyrdia.data.*
import io.ktor.http.*
import io.ktor.server.application.*
val comments = CommentRenderData(
Comment.Table
.sorted(Sorts.descending(Comment::submittedAt.serialName))
- .filterNot { comment ->
- comment.submittedBy != currNation?.id && NationData.get(comment.submittedBy).isBanned
+ .let { flow ->
+ if (currNation?.id == OwnerNationId)
+ flow
+ else flow.filterNot { comment ->
+ comment.submittedBy != currNation?.id && NationData.get(comment.submittedBy).isBanned
+ }
}
.take(limit)
.toList(),