Пример #1
0
        public bool Send(ClientMessage clientMessage)
        {
            if (!_commandDispatcher.TryHandleCommand(clientMessage, this))
            {
                // The message is not a command so treat it as a normal message
                var message = new MessageViewModel
                {
                    User    = GetUserInfo(),
                    Id      = clientMessage.Id,
                    Content = clientMessage.Content,
                    When    = DateTimeOffset.Now
                };

                Clients.Group(clientMessage.Room).addMessage(message, clientMessage.Room);
            }

            return(true);
        }