Owner nation may see all comments in RSS feed
authorLanius Trolling <lanius@laniustrolling.dev>
Thu, 11 Jan 2024 16:09:33 +0000 (11:09 -0500)
committerLanius Trolling <lanius@laniustrolling.dev>
Thu, 11 Jan 2024 16:09:33 +0000 (11:09 -0500)
src/jvmMain/kotlin/info/mechyrdia/lore/views_rss.kt

index 2cd2f601d7c0bcadf30e0655a0efcefd41eaba1d..f224f4f600fdbfd123b9df69732e8e7d3024ef11 100644 (file)
@@ -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(),