diff --git a/src/main/java/com/ogjg/daitgym/chat/service/ChatMessageService.java b/src/main/java/com/ogjg/daitgym/chat/service/ChatMessageService.java index efcedb76..8991a1cf 100644 --- a/src/main/java/com/ogjg/daitgym/chat/service/ChatMessageService.java +++ b/src/main/java/com/ogjg/daitgym/chat/service/ChatMessageService.java @@ -93,11 +93,11 @@ public List loadMessage(String redisRoomId, User user) { List 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 redisMessageList = redisTemplateMessage.opsForList().range(redisRoomId, 0, -1); // // if (redisMessageList == null || redisMessageList.isEmpty() || redisMessageList.size() < dbMessageList.size()) {