From 66dbd20a9090fdd77e67382bcf58abff94b3f2b0 Mon Sep 17 00:00:00 2001 From: Koen Date: Thu, 19 Oct 2023 14:52:11 +0200 Subject: [PATCH] Comment truncation --- .../java/com/futo/platformplayer/states/StatePolycentric.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/futo/platformplayer/states/StatePolycentric.kt b/app/src/main/java/com/futo/platformplayer/states/StatePolycentric.kt index 5e28ab3a..29a0d23d 100644 --- a/app/src/main/java/com/futo/platformplayer/states/StatePolycentric.kt +++ b/app/src/main/java/com/futo/platformplayer/states/StatePolycentric.kt @@ -302,7 +302,7 @@ class StatePolycentric { thumbnail = imageBundle?.selectBestImage(dp_25 * dp_25)?.let { img -> img.toURLInfoSystemLinkUrl(ev.system.toProto(), img.process, listOf(PolycentricCache.SERVER)) }, subscribers = null ), - msg = post.content.substring(0, PolycentricPlatformComment.MAX_COMMENT_SIZE), + msg = if (post.content.count() > PolycentricPlatformComment.MAX_COMMENT_SIZE) post.content.substring(0, PolycentricPlatformComment.MAX_COMMENT_SIZE) else post.content, rating = RatingLikeDislikes(likes, dislikes), date = if (unixMilliseconds != null) Instant.ofEpochMilli(unixMilliseconds).atOffset(ZoneOffset.UTC) else OffsetDateTime.MIN, replyCount = replies.toInt(),