/// <summary> /// This call is for submitting comments that weren't marked as spam but should've been. /// </summary> /// <param name="comment">The comment.</param> public void SubmitSpam(CheckCommentForSpam comment) { if (VerifyKey) { AkismetComment akismetComment = ConvertCommentToAkismetComment(comment); Service.SubmitSpam(akismetComment); } }
/// <summary> /// Determines whether the specified comment is spam. /// </summary> /// <param name="comment">The comment.</param> /// <returns> /// <c>true</c> if the specified comment is spam; otherwise, <c>false</c>. /// </returns> public bool IsSpam(CheckCommentForSpam comment) { if (VerifyKey) { AkismetComment akismetComment = ConvertCommentToAkismetComment(comment); return(Service.CommentCheck(akismetComment)); } return(false); }
/// <summary> /// Determines whether the specified comment is spam. /// </summary> /// <param name="comment">The comment.</param> /// <returns> /// <c>true</c> if the specified comment is spam; otherwise, <c>false</c>. /// </returns> public bool IsSpam(CheckCommentForSpam comment) { if (VerifyKey) { AkismetComment akismetComment = ConvertCommentToAkismetComment(comment); return Service.CommentCheck(akismetComment); } return false; }
/// <summary> /// Converts the comment to akismet comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns></returns> private AkismetComment ConvertCommentToAkismetComment(CheckCommentForSpam comment) { AkismetComment akismet = new AkismetComment { Blog = "http://momntz.com", CommentAuthor = comment.Author, CommentAuthorEmail = comment.AuthorEmail, CommentAuthorUrl = comment.AuthorUrl, CommentContent = comment.Body, CommentType = "comment", UserAgent = comment.UserAgent, UserIp = comment.UserIP }; return(akismet); }
/// <summary> /// Converts the comment to akismet comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns></returns> private AkismetComment ConvertCommentToAkismetComment(CheckCommentForSpam comment) { AkismetComment akismet = new AkismetComment { Blog = "http://momntz.com", CommentAuthor = comment.Author, CommentAuthorEmail = comment.AuthorEmail, CommentAuthorUrl = comment.AuthorUrl, CommentContent = comment.Body, CommentType = "comment", UserAgent = comment.UserAgent, UserIp = comment.UserIP }; return akismet; }