I've noticed an increased number of false-positives in Akismet. It appears that when a moderator marks a user as a spammer using the FriendsOfFlarum Spamblock extension, the spam is reported as a false-positive. This happens because when the flag is removed, the PostWasApproved event from the flarum/approval extension is triggered, which leads to the Ham submission to Akismet. I have an extension that logs all events on the forum, and it confirms my observations.
Current Behavior
I've noticed an increased number of false-positives in Akismet. It appears that when a moderator marks a user as a spammer using the FriendsOfFlarum Spamblock extension, the spam is reported as a false-positive. This happens because when the flag is removed, the
PostWasApproved
event from theflarum/approval
extension is triggered, which leads to the Ham submission to Akismet. I have an extension that logs all events on the forum, and it confirms my observations.https://github.com/FriendsOfFlarum/spamblock/blob/5f5aa0ce42068342d3e78612bd75e87eebe0cb49/src/Controllers/MarkAsSpammerController.php#L97
Steps to Reproduce
DeleteFlags
command fromflarum/flags
.Expected Behavior
The Approval extension shouldn't trigger the
PostWasApproved
event when a flag is removed but only when the post is genuinely approved.Screenshots
Environment
Possible Solution
I can create a PR for 1.x. However, I am uncertain whether I should fix this in
flarum/approval
orflarum/akismet
?https://github.com/flarum/framework/blob/f07336e204aef7876170174865e0b04c0ee7d16d/extensions/akismet/src/Listener/SubmitHam.php#L1-L45