From: Lanius Trolling Date: Thu, 11 Jan 2024 16:09:33 +0000 (-0500) Subject: Owner nation may see all comments in RSS feed X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=46f205b774dbd97d8ac09baf02815cb64f93e51d;p=factbooks Owner nation may see all comments in RSS feed --- 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(),