Exemplo n.º 1
0
        public async Task HandleAsync()
        {
            try
            {
                List <ChatUserDto> chatUsers = await loadChatsService.GetChatUsersAsync(request.UsersId, request.ChatId).ConfigureAwait(false);

                ChatUsersNodeResponse response = new ChatUsersNodeResponse(request.RequestId, ChatUserConverter.GetChatUsersVm(chatUsers));
                NodeWebSocketCommunicationManager.SendResponse(response, current);
            }
            catch (Exception ex)
            {
                Logger.WriteLog(ex);
                NodeWebSocketCommunicationManager.SendResponse(new ResultNodeResponse(request.RequestId, ObjectsLibrary.Enums.ErrorCode.UnknownError), current);
            }
        }
Exemplo n.º 2
0
        public async Task <List <ChatUserVm> > GetChatUsersInformationAsync(List <long> usersId, long chatId, NodeConnection nodeConnection)
        {
            try
            {
                GetChatUsersInformationNodeRequest request = new GetChatUsersInformationNodeRequest(usersId, chatId);
                SendRequest(nodeConnection, request);
                ChatUsersNodeResponse response = (ChatUsersNodeResponse) await GetResponseAsync(request).ConfigureAwait(false);

                return(response.ChatUsers);
            }
            catch
            {
                return(null);
            }
        }