Skip to content

Akismet-based spam moderation for blog comments - #845

Merged
poppastring merged 4 commits into
mainfrom
resolve-spam-akisment
Jun 2, 2026
Merged

poppastring merged 4 commits into
mainfrom
resolve-spam-akisment

Conversation

@poppastring

Copy link
Copy Markdown
Owner

PR Classification

New feature: Adds Akismet-based spam moderation for blog comments.

PR Summary

This PR integrates Akismet spam detection into DasBlog Core, enabling automated and admin-driven spam handling for comments. It also modernizes the Akismet client and updates the admin UI for spam management.

  • CommentManager.cs: Adds async spam checking and admin spam/ham reporting logic.
  • AkismetSpamBlockingService.cs: Implements Akismet-backed ISpamBlockingService with async HTTP support.
  • AdminController.cs, BlogPostController.cs, and related TagHelpers/Views: Add UI and endpoints for marking comments as spam.
  • ISiteConfig.cs, SiteConfig.cs, and site.config: Add EnableSpamModeration and AkismetAPIKey settings.
  • Subtext.Akismet: Refactors client for .NET 10, async HTTP, and removes legacy code.

Integrates Akismet spam filtering via AkismetSpamBlockingService and updates CommentManager to check/report spam using ISpamBlockingService. Adds Akismet API key support to config and admin UI. Refactors Subtext.Akismet for .NET 10, removes legacy HttpClient, and updates solution/projects for new dependencies and compatibility. Updates tests and view models for new spam moderation features.
Implements backend, API, and UI for marking comments as spam. Updates CommentManager, interfaces, and BlogDataService to support spam flagging and reporting. Adds PATCH endpoint and tag helper for admin UI. Improves Akismet integration and spam service checks. Updates config and UI to enable and display the new action.
Expanded CommentManager tests for spam scenarios, including spam detection, admin bypass, service enable/disable, and spam reporting. Added AkismetSpamBlockingService tests to verify enablement logic and ensure no network calls or side effects when disabled.
Refactored ISpamBlockingService and AkismetSpamBlockingService to use Task-based async methods for spam checking and reporting. Updated CommentManager and all controller/test call sites to use AddCommentAsync and async/await. AkismetClient now provides async network operations with cancellation support. Fire-and-forget spam/ham reporting now logs exceptions as warnings. All related unit tests updated for async APIs.
@poppastring
poppastring merged commit 3d39fbc into main Jun 2, 2026
3 checks passed
@poppastring
poppastring deleted the resolve-spam-akisment branch June 2, 2026 02:32
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.

1 participant