From a58de0cf924fe35b0a8733ad8d7754b7e97368ef Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 28 Aug 2025 02:33:04 +0900 Subject: [PATCH] =?UTF-8?q?feat(chat-room-list):=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=A9=94=EC=8B=9C=EC=A7=80=EB=A9=B4=20=EC=B5=9C?= =?UTF-8?q?=EA=B7=BC=20=EB=A9=94=EC=8B=9C=EC=A7=80=EB=A5=BC=20[=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80]=EB=A1=9C=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/chat/room/service/ChatRoomService.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/chat/room/service/ChatRoomService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/chat/room/service/ChatRoomService.kt index a235ae0..ddf4279 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/chat/room/service/ChatRoomService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/chat/room/service/ChatRoomService.kt @@ -251,8 +251,16 @@ class ChatRoomService( ).apply { id = q.chatRoomId } val latest = messageRepository.findTopByChatRoomAndIsActiveTrueOrderByCreatedAtDesc(room) - val preview = latest?.message?.let { msg -> - if (msg.length <= 30) msg else msg.take(30) + "..." + val preview = if (latest?.message?.isNotBlank() == true) { + latest.message.let { msg -> + if (msg.length <= 30) msg else msg.take(30) + "..." + } + } else { + if (latest?.message.isNullOrBlank() && latest?.characterImage != null) { + "[이미지]" + } else { + "" + } } val imageUrl = "$imageHost/${q.imagePath ?: "profile/default-profile.png"}"