You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/05/06 08:43:49 UTC

(incubator-answer-plugins) branch feat/akismet updated: feat(akismet): add test case for akismet

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch feat/akismet
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git


The following commit(s) were added to refs/heads/feat/akismet by this push:
     new e594f3c  feat(akismet): add test case for akismet
e594f3c is described below

commit e594f3cfebd551f7cd0f7d6b70b4535094e0c0f4
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Mon May 6 16:43:41 2024 +0800

    feat(akismet): add test case for akismet
---
 reviewer-akismet/akismet.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/reviewer-akismet/akismet.go b/reviewer-akismet/akismet.go
index 81e3ed9..9b829e7 100644
--- a/reviewer-akismet/akismet.go
+++ b/reviewer-akismet/akismet.go
@@ -18,6 +18,10 @@ func (r *Reviewer) RequestAkismetToCheck(content *plugin.ReviewContent) (isSpam
 	req["comment_content"] = content.Title + "\n" + content.Content
 	req["comment_type"] = "comment"
 	req["is_test"] = "false"
+	// This is for test if the akismet is available.
+	if content.Title == "akismet-guaranteed-spam" {
+		req["comment_content"] = content.Title
+	}
 
 	log.Debugf("request akismet: %+v", req)