public string GetPublishMessageQuery(string messageText, IUserIdentifier targetUserDTO)
        {
            if (!_messageQueryValidator.IsMessageTextValid(messageText) || !_userQueryValidator.CanUserBeIdentified(targetUserDTO))
            {
                return(null);
            }

            string identifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(targetUserDTO);

            return(GetPublishMessageFormattedQuery(messageText, identifierParameter));
        }
Beispiel #2
0
        // Publish Message
        public string GetPublishMessageQuery(IMessagePublishParameters parameters)
        {
            var messageText = parameters.Text;
            var recipient   = parameters.Recipient;

            if (!_messageQueryValidator.IsMessageTextValid(messageText) || !_userQueryValidator.CanUserBeIdentified(recipient))
            {
                return(null);
            }

            string identifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(recipient);

            return(GetPublishMessageFormattedQuery(messageText, identifierParameter));
        }
        // Publish Message
        public string GetPublishMessageQuery(IPublishMessageParameters parameters)
        {
            var messageText = parameters.Text;
            var recipient   = parameters.Recipient;

            if (!_messageQueryValidator.IsMessageTextValid(messageText) || !_userQueryValidator.CanUserBeIdentified(recipient))
            {
                return(null);
            }

            var identifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(recipient);

            var query = GetPublishMessageFormattedQuery(messageText, identifierParameter);

            query += _queryParameterGenerator.GenerateAdditionalRequestParameters(parameters.FormattedCustomQueryParameters);

            return(query);
        }