Skip to content

Commit

Permalink
fix: Updated TopicService.getPrivateTopic and delete method TopicServ…
Browse files Browse the repository at this point in the history
…ice.generatePrivateName
  • Loading branch information
Vladik-gif committed Sep 27, 2024
1 parent 9b363a2 commit 641e851
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/java/com/chat/yourway/service/TopicService.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ public List<TopicResponseDto> findTopicsByTopicName(String topicName) {
return toListResponseDto(topicRepository.findAllByName(topicName), contactService.getCurrentContact());
}

private String generatePrivateName(String sendTo, String email) {
return UUID.randomUUID().toString();
}

public List<PublicTopicInfoResponseDto> findAllFavouriteTopics() {
Contact contact = contactService.getCurrentContact();
return toListInfoResponseDto(contact.getFavoriteTopics(), contact);
Expand All @@ -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();
Expand Down

0 comments on commit 641e851

Please sign in to comment.