Draft: Add community required beneficiaries feature with MUTED_BENEFICIARY type

Implements a new community setting that allows communities to enforce required beneficiaries on top-level posts. Posts that don't meet the requirements are automatically muted with a new mute type.

Changes:

  • Add MUTED_BENEFICIARY (5) mute type to muted_reasons_operations.sql
  • Create validate_required_beneficiaries() SQL function in hive_post_operations.sql that handles all validation logic and muting
  • Add required_beneficiaries validation in community.py settings parser
  • Update comment_options_op to call SQL validation function and send notifications
  • Add MUTED_BENEFICIARY notification message in comment_op

Key features:

  • Validates only top-level posts (depth = 0) in communities
  • Strict validation: posts must have exact percentage or higher
  • Only applies to new posts during sync, no retroactive processing
  • Stored in JSONB settings field

Merge request reports

Loading