Skip to content

Conversation

@ClayDowling
Copy link

Added the trigger and performed a small refactor to put all of the spam
checking logic into a single method. A note was also added to the
README concerning use of the trigger.

The intent of this pull request is to add a trigger for interaction with the StopForumSpam plugin. The trigger is used by ClayDowling/StopForumSpam#4 and there is a demo running at http://claydowling.com

Added the trigger and performed a small refactor to put all of the spam
checking logic into a single method.  A note was also added to the
README concerning use of the trigger.
action.php Outdated
*/
protected function _add($comment, $parent) {
global $ID;
protected function _not_spam($comment) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename it to something that is not a double negative?
(_not_spam()===false is just isSpam(), it isn't?)

@michitux
Copy link
Member

In general I think this is a very good idea. However, there are at least two issues to solve before merging this:

Some more thoughts:

  • The word block check could be the default action such that it can also be disabled by a plugin handling the event.
  • Being able to pass a custom message for the user might be a good idea.
  • Instead of not saving the message a possible action could also be to save the comment as hidden such that it needs to be explicitly approved by a moderator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants