Don't let people know about shadowbanned comments
authorLanius Trolling <lanius@laniustrolling.dev>
Tue, 14 Mar 2023 18:59:54 +0000 (14:59 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Tue, 14 Mar 2023 18:59:54 +0000 (14:59 -0400)
src/main/kotlin/info/mechyrdia/data/views_comment.kt

index 9fa64874432aa7bb6494a21e38006a91a972ecaa..896e96fed54cd65dbc9aeaa7531dd90c72c22172 100644 (file)
@@ -13,6 +13,7 @@ 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 {
@@ -102,7 +103,7 @@ suspend fun ApplicationCall.viewCommentRoute(): Nothing {
        val submitter = nationCache.getNation(comment.submittedBy)
        
        if (submitter.isBanned && currentNation?.id != comment.submittedBy && currentNation?.id != OwnerNationId)
-               redirectWithError("/lore/${comment.submittedIn}", "The user who posted that comment is banned from commenting", "comments")
+               throw NullPointerException("Shadowbanned comment")
        
        val queryParams = if (request.queryParameters.isEmpty())
                ""