public async Task GetUserConversations() { var conversations = await _conversationService.GetConversationsForUserAsync(DataContainer.GetUserId()); UserConversations.Clear(); foreach (var conversation in conversations) { UserConversations.Add(conversation); } foreach (var conversation in conversations) { await _messageService.JoinChat(conversation); } }
public async Task <ConversationDTO> GetConversationWithUser(string username) { var userPair = new UserPairIdUsernameDTO() { UserId = DataContainer.GetUserId(), Username = username }; var conversation = await _conversationService.GetConversationWithUser(userPair); if (conversation == null) { return(conversation); } DataContainer.ConversationDTO = conversation; if (conversation.ConversationLastMessage is null) { UserConversations.Add(conversation); await _messageService.JoinChat(conversation); } return(conversation); }
public async Task RegisterNewGroupConversation() { UserConversations.Add(DataContainer.ConversationDTO); await _messageService.JoinChat(DataContainer.ConversationDTO); }