Skip to content

Commit

Permalink
fix: ContactService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Sep 20, 2024
1 parent eebf9c1 commit 6681e69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/chat/yourway/service/ContactService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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<Contact> 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);
Expand Down

0 comments on commit 6681e69

Please sign in to comment.