Class PrivateChatService

java.lang.Object
vaultWeb.services.PrivateChatService

@Service public class PrivateChatService extends Object
Service class for handling private chats between two users.

Provides functionality to retrieve an existing private chat or create a new one if it does not exist.

  • Constructor Details

    • PrivateChatService

      public PrivateChatService()
  • Method Details

    • getOrCreatePrivateChat

      public PrivateChat getOrCreatePrivateChat(String username1, String username2)
      Retrieves an existing private chat between two users or creates a new one if none exists.
      Parameters:
      username1 - The username of the first user.
      username2 - The username of the second user.
      Returns:
      The existing or newly created PrivateChat entity.
      Throws:
      UserNotFoundException - if either user does not exist.
    • clearMultipleChats

      @Transactional public int clearMultipleChats(List<Long> privateChatIds, String currentUsername)
    • getUserPrivateChats

      public List<PrivateChat> getUserPrivateChats(String username)
    • createGroupFromChats

      @Transactional public Long createGroupFromChats(List<Long> privateChatIds, String groupName, String description, String currentUserName)