Beispiel #1
0
        public static ChatRequest createLoggedFriendsRequest(chat.model.User user)
        {
            proto.User  userDTO = proto.User.CreateBuilder().SetId(user.Id).Build();
            ChatRequest request = ChatRequest.CreateBuilder().SetType(ChatRequest.Types.Type.GetLoggedFriends)
                                  .SetUser(userDTO).Build();

            return(request);
        }
Beispiel #2
0
        public static ChatRequest createLoginRequest(chat.model.User user)
        {
            proto.User  userDTO = proto.User.CreateBuilder().SetId(user.Id).SetPasswd(user.Password).Build();
            ChatRequest request = ChatRequest.CreateBuilder().SetType(ChatRequest.Types.Type.Login)
                                  .SetUser(userDTO).Build();

            return(request);
        }
Beispiel #3
0
        public static ChatRequest createSendMesssageRequest(chat.model.Message message)
        {
            proto.Message messageDTO = proto.Message.CreateBuilder().
                                       SetSenderId(message.Sender.Id)
                                       .SetReceiverId(message.Receiver.Id)
                                       .SetText(message.Text).Build();
            ChatRequest request = ChatRequest.CreateBuilder()
                                  .SetType(ChatRequest.Types.Type.SendMessage)
                                  .SetMessage(messageDTO).Build();

            return(request);
        }