Exemple #1
0
        public SendMessageReply SendMessage(SendMessageRequest request)
        {
            MessageStatus messageStatus = MessageStatus.MessageFailed;

            lock (this)
            {
                messageStatus = serverManagement.SendMessage(request.Message, request.User, request.Url);
            }
            if (messageStatus.Equals(MessageStatus.MessageSent))
            {
                Console.WriteLine($"Client {request.User.Name} with Id {request.User.Id} sent a message at {request.Url}");
            }
            else
            {
                Console.WriteLine($"Client {request.User.Name} with Id {request.User.Id} FAILED to send a message at {request.Url}");
            }
            return(new SendMessageReply
            {
                Status = messageStatus
            });
        }