From 6569cd1a15031717c2d8d75690666b6438a6a632 Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Tue, 14 Mar 2023 14:59:54 -0400 Subject: [PATCH] Don't let people know about shadowbanned comments --- src/main/kotlin/info/mechyrdia/data/views_comment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/info/mechyrdia/data/views_comment.kt b/src/main/kotlin/info/mechyrdia/data/views_comment.kt index 9fa6487..896e96f 100644 --- a/src/main/kotlin/info/mechyrdia/data/views_comment.kt +++ b/src/main/kotlin/info/mechyrdia/data/views_comment.kt @@ -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()) "" -- 2.25.1