コード例 #1
0
ファイル: BlogSpamNet.cs プロジェクト: Pathfinder-Fr/Website
        /// <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);
        }
コード例 #2
0
ファイル: BlogSpamNet.cs プロジェクト: Pathfinder-Fr/Website
 /// <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));
 }
コード例 #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);
 }
コード例 #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;
        }
コード例 #5
0
ファイル: BlogSpamNet.cs プロジェクト: RH-Code/YAFNET
        /// <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;
        }