From 3782062f4a5e050fa52d984cbafe16f50563e9d2 Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 10 Sep 2025 13:31:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(chat-room):=20=EC=9E=85=EC=9E=A5/=EC=A0=84?= =?UTF-8?q?=EC=86=A1=20next=20=EA=B3=84=EC=82=B0=20=EB=B3=B4=EC=99=84=20?= =?UTF-8?q?=EB=B0=8F=20=EC=B1=84=ED=8C=85=20=EA=B0=80=EB=8A=A5=20=EC=8B=9C?= =?UTF-8?q?=20next=3Dnull=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enter: roomPaid==0 && roomFree>0 && global<=0 → 글로벌 next roomPaid==0 && roomFree==0 → (global<=0) ? max(roomNext, globalNext) : roomNext 채팅 가능(totalRemaining>0)인 경우 next=null 반환(유료>0 포함) send: totalRemaining==0 && global<=0 → max(roomNext, globalNext) 채팅 가능(totalRemaining>0)인 경우 next=null 반환 --- .../sodalive/chat/room/service/ChatRoomService.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 1835fe5..abd21c4 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 @@ -428,8 +428,10 @@ class ChatRoomService( } } - // 권고안에 따른 next 계산 + // 권고안 + 이슈 보정: 채팅 가능(totalRemaining>0)인 경우 next=null val nextForEnter: Long? = when { + // 채팅 가능: 유료>0 또는 무료 동시 사용 가능 → next는 표시하지 않음 + roomStatus.totalRemaining > 0 -> null // roomPaid==0 && roomFree>0 && global<=0 → 글로벌 next roomStatus.remainingPaid == 0 && roomStatus.remainingFree > 0 && globalStatus.totalRemaining <= 0 -> globalStatus.nextRechargeAtEpochMillis @@ -443,10 +445,7 @@ class ChatRoomService( } else if (globalNext == null) { roomNext } else { - maxOf( - roomNext, - globalNext - ) + maxOf(roomNext, globalNext) } } else { roomNext @@ -693,6 +692,8 @@ class ChatRoomService( val statusTotalRemaining = roomQuotaAfterConsume.totalRemaining val globalAfter = chatQuotaService.getStatus(member.id!!) val statusNextRechargeAt: Long? = when { + // 채팅 가능: totalRemaining>0 → next 표시하지 않음 + statusTotalRemaining > 0 -> null // totalRemaining==0이고 (global<=0) → max(roomNext, globalNext) statusTotalRemaining == 0 && globalAfter.totalRemaining <= 0 -> { val roomNext = roomQuotaAfterConsume.nextRechargeAtEpochMillis