Skip to content

Commit

Permalink
Fix : DIG-13 전체 메세지 조회 버그 수정
Browse files Browse the repository at this point in the history
- ChatMessageService
    - 전체 메시지 조회시, 상대방의 채팅메세지가 본인걸로 넘어오는 버그 발생
    - 로그인한 유저의 값으로만 넘겨받아 문제가 발생함
    - 채팅을 보낸 모든 유저의 값을 보내줌
  • Loading branch information
YEJINGO committed Nov 18, 2023
1 parent d3f61f8 commit 66dd981
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public List<ChatMessageDto> loadMessage(String redisRoomId, User user) {
List<ChatMessage> dbMessageList = chatMessageRepository.findAllByRedisRoomIdOrderByMessageCreatedAtAsc(redisRoomId);

for (ChatMessage chatMessage : dbMessageList) {
chatMessageDtos.add(new ChatMessageDto(chatMessage, user));
User sender = chatMessage.getUser();
chatMessageDtos.add(new ChatMessageDto(chatMessage, sender));
}
return chatMessageDtos;


// List<ChatMessageDto> redisMessageList = redisTemplateMessage.opsForList().range(redisRoomId, 0, -1);
//
// if (redisMessageList == null || redisMessageList.isEmpty() || redisMessageList.size() < dbMessageList.size()) {
Expand Down

0 comments on commit 66dd981

Please sign in to comment.