From: Lanius Trolling Date: Tue, 14 Mar 2023 18:59:54 +0000 (-0400) Subject: Don't let people know about shadowbanned comments X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=6569cd1a15031717c2d8d75690666b6438a6a632;p=factbooks Don't let people know about shadowbanned comments --- 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()) ""