From 641e8519c2c17a3873f636f7cdbce2e0a0cda772 Mon Sep 17 00:00:00 2001 From: Vladik-gif Date: Fri, 27 Sep 2024 11:32:11 +0300 Subject: [PATCH] fix: Updated TopicService.getPrivateTopic and delete method TopicService.generatePrivateName --- src/main/java/com/chat/yourway/service/TopicService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/chat/yourway/service/TopicService.java b/src/main/java/com/chat/yourway/service/TopicService.java index ee37ae5..c12ba7d 100644 --- a/src/main/java/com/chat/yourway/service/TopicService.java +++ b/src/main/java/com/chat/yourway/service/TopicService.java @@ -165,10 +165,6 @@ public List findTopicsByTopicName(String topicName) { return toListResponseDto(topicRepository.findAllByName(topicName), contactService.getCurrentContact()); } - private String generatePrivateName(String sendTo, String email) { - return UUID.randomUUID().toString(); - } - public List findAllFavouriteTopics() { Contact contact = contactService.getCurrentContact(); return toListInfoResponseDto(contact.getFavoriteTopics(), contact); @@ -185,7 +181,7 @@ public Topic getPrivateTopic(Contact sendToContact, Contact sendFromContact) { () -> { Topic newPrivateTopic = Topic.builder() .contact(sendToContact) - .name(generatePrivateName(sendToContact.getEmail(), sendFromContact.getEmail())) + .name(sendToContact.getNickname()) .scope(TopicScope.PRIVATE) .topicSubscribers(List.of(sendToContact, sendFromContact)) .build();