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"}"