From 46f205b774dbd97d8ac09baf02815cb64f93e51d Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Thu, 11 Jan 2024 11:09:33 -0500 Subject: [PATCH] Owner nation may see all comments in RSS feed --- src/jvmMain/kotlin/info/mechyrdia/lore/views_rss.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/jvmMain/kotlin/info/mechyrdia/lore/views_rss.kt b/src/jvmMain/kotlin/info/mechyrdia/lore/views_rss.kt index 2cd2f60..f224f4f 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/lore/views_rss.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/lore/views_rss.kt @@ -2,6 +2,7 @@ package info.mechyrdia.lore 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.* @@ -101,8 +102,12 @@ suspend fun ApplicationCall.recentCommentsRssFeedGenerator(): Appendable.() -> U 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(), -- 2.25.1