diff --git a/src/main/java/com/chat/yourway/service/ContactService.java b/src/main/java/com/chat/yourway/service/ContactService.java index ec9fff8..0c5b2f2 100644 --- a/src/main/java/com/chat/yourway/service/ContactService.java +++ b/src/main/java/com/chat/yourway/service/ContactService.java @@ -108,6 +108,7 @@ public boolean isEmailExists(String email) { return contactRepository.existsByEmailIgnoreCase(email); } + @Transactional public ContactProfileResponseDto getContactProfile() { Contact contact = getCurrentContact(); log.trace("Started get contact profile by email [{}]", contact.getEmail()); @@ -154,10 +155,10 @@ private void changePermissionSendingPrivateMessages(String email, boolean isPerm } @Transactional - public void addUnreadMessageToTopicSubscribers(Contact excludeСontact, Message message) { + public void addUnreadMessageToTopicSubscribers(Contact contact, Message message) { List topicSubscribers = message.getTopic().getTopicSubscribers() .stream() - .filter(c -> !c.equals(excludeСontact)) + .filter(c -> !c.equals(contact)) .toList(); for (Contact topicSubscriber : topicSubscribers) { topicSubscriber.getUnreadMessages().add(message);