diff --git a/src/main/java/com/team/cklob/gami/domain/chat/service/impl/GetChatRoomListServiceImpl.java b/src/main/java/com/team/cklob/gami/domain/chat/service/impl/GetChatRoomListServiceImpl.java index 0ee5a4a..010f6f8 100644 --- a/src/main/java/com/team/cklob/gami/domain/chat/service/impl/GetChatRoomListServiceImpl.java +++ b/src/main/java/com/team/cklob/gami/domain/chat/service/impl/GetChatRoomListServiceImpl.java @@ -1,6 +1,7 @@ package com.team.cklob.gami.domain.chat.service.impl; import com.team.cklob.gami.domain.chat.entity.ChatRoom; +import com.team.cklob.gami.domain.chat.entity.constant.RoomStatus; import com.team.cklob.gami.domain.chat.dto.response.GetChatRoomListResponse; import com.team.cklob.gami.domain.chat.repository.ChatRoomRepository; import com.team.cklob.gami.domain.chat.service.GetChatRoomListService; @@ -31,7 +32,11 @@ public List execute() { Member member = memberUtil.getCurrentMember(); List chatRoomList = chatRoomRepository - .findAllByMentorIdOrMenteeId(member.getId()); + .findAllByMentorIdOrMenteeId(member.getId()) + .stream() + .filter(chatRoom -> chatRoom.getRoomStatus() == RoomStatus.ACTIVE) + .filter(chatRoom -> !chatRoom.hasLeft(member)) + .toList(); List otherMemberIds = chatRoomList.stream() .map(chatRoom -> { @@ -67,4 +72,4 @@ public List execute() { }) .toList(); } -} +} \ No newline at end of file