Beispiel #1
0
 public async Task SendPrivateMessage(string User, string Message)
 {
     PostPrivateMessage postPrivateMessage = new PostPrivateMessage {
         User = User, ClientName = Client, Message = Message
     };
     string message = JsonConvert.SerializeObject(postPrivateMessage);
     await CommonClient.PostAsync(new Uri($"{Url}private_chat/{CommonClient.Escape(Client)}/{CommonClient.Escape(User)}/send"), message, HttpClient);
 }
Beispiel #2
0
        public async Task PostSendPrivateMessage(HttpContext context)
        {
            var inputDoc = await context.ReadStringAsync();

            PostPrivateMessage postPrivateMessage = JsonConvert.DeserializeObject <PostPrivateMessage>(inputDoc);
            var client  = postPrivateMessage.ClientName;
            var user    = postPrivateMessage.User;
            var message = postPrivateMessage.Message;

            await chatFacade.SendPrivateMessage(client, user, message);

            await context.RespondStringAsync(inputDoc);
        }