Ejemplo n.º 1
0
        public static ChatRequest createSendMesssageRequest(chat.model.Message message)
        {
            proto.Message messageDTO = new proto.Message
            {
                SenderId   = message.Sender.Id,
                ReceiverId = message.Receiver.Id,
                Text       = message.Text
            };

            ChatRequest request = new ChatRequest {
                Type = ChatRequest.Types.Type.SendMessage, Message = messageDTO
            };

            return(request);
        }
Ejemplo n.º 2
0
        public static ChatResponse createNewMessageResponse(chat.model.Message message)
        {
            proto.Message messageDTO = new proto.Message
            {
                SenderId   = message.Sender.Id,
                ReceiverId = message.Receiver.Id,
                Text       = message.Text
            };

            ChatResponse response = new ChatResponse {
                Type = ChatResponse.Types.Type.NewMessage, Message = messageDTO
            };

            return(response);
        }