From 6681e69e93a085376eb2d7122495c421aa2f0f45 Mon Sep 17 00:00:00 2001 From: Vladik-gif Date: Fri, 20 Sep 2024 13:10:40 +0300 Subject: [PATCH] fix: ContactService.java --- src/main/java/com/chat/yourway/service/ContactService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);