Ejemplo n.º 1
0
        /// <summary>
        /// Test a Comment for SPAM
        /// </summary>
        /// <param name="comment">The comment.</param>
        /// <param name="ignoreInternalIp">Ignore Internal Ip</param>
        /// <param name="answer">The answer.</param>
        /// <returns>
        /// Returns if Comment is SPAM
        /// </returns>
        public static bool CommentIsSpam(BlogSpamComment comment, bool ignoreInternalIp, out string answer)
        {
            answer = GetProxy().testComment(comment);

            string result = answer;

            // Handle interal Ips not as spam
            if (answer.Equals("SPAM:Internal Only IP") && ignoreInternalIp)
            {
                return(false);
            }

            // Handle interal Ips not as spam
            if (answer.Equals("SPAM:No reverse DNS entry for ::1") && ignoreInternalIp)
            {
                return(false);
            }

            if (result.Contains(":"))
            {
                result = result.Remove(result.IndexOf(":"));
            }

            switch (result)
            {
            case "OK":
                return(false);

            case "SPAM":
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Test a Comment for SPAM
 /// </summary>
 /// <param name="comment">
 /// The comment.
 /// </param>
 /// <returns>
 /// The test comment.
 /// </returns>
 public static string TestComment(BlogSpamComment comment)
 {
     return(GetProxy().testComment(comment));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Test a Comment for SPAM
 /// </summary>
 /// <param name="comment">
 /// The comment.
 /// </param>
 /// <returns>
 /// The test comment.
 /// </returns>
 public static string TestComment(BlogSpamComment comment)
 {
     return GetProxy().testComment(comment);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Test a Comment for SPAM
        /// </summary>
        /// <param name="comment">
        /// The comment.
        /// </param>
        /// <param name="ignoreInternalIp">
        /// Ignore Internal Ip
        /// </param>
        /// <returns>
        /// Returns if Comment is SPAM
        /// </returns>
        public static bool CommentIsSpam(BlogSpamComment comment, bool ignoreInternalIp)
        {
            string answer = GetProxy().testComment(comment);

            // Handle interal Ips not as spam
            if (answer.Equals("SPAM:Internal Only IP") && ignoreInternalIp)
            {
                return false;
            }

            if (answer.Contains(":"))
            {
                answer = answer.Remove(answer.IndexOf(":"));
            }

            switch (answer)
            {
                case "OK":
                    return false;
                case "SPAM":
                    return true;
            }

            return false;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Test a Comment for SPAM
        /// </summary>
        /// <param name="comment">The comment.</param>
        /// <param name="ignoreInternalIp">Ignore Internal Ip</param>
        /// <param name="answer">The answer.</param>
        /// <returns>
        /// Returns if Comment is SPAM
        /// </returns>
        public static bool CommentIsSpam(BlogSpamComment comment, bool ignoreInternalIp, out string answer)
        {
            answer = GetProxy().testComment(comment);

            string result = answer;

            // Handle interal Ips not as spam
            if (answer.Equals("SPAM:Internal Only IP") && ignoreInternalIp)
            {
                return false;
            }

            // Handle interal Ips not as spam
            if (answer.Equals("SPAM:No reverse DNS entry for ::1") && ignoreInternalIp)
            {
                return false;
            }

            if (result.Contains(":"))
            {
                result = result.Remove(result.IndexOf(":"));
            }

            switch (result)
            {
                case "OK":
                    return false;
                case "SPAM":
                    return true;
            }

            return false;
        }