services:
    _defaults:
        autoconfigure: true

    contao_comments.cron.purge_subscriptions:
        class: Contao\CommentsBundle\Cron\PurgeSubscriptionsCron
        arguments:
            - '@contao.framework'
            - '@?monolog.logger.contao.cron'

    contao_comments.listener.data_container.add_comment_fields:
        class: Contao\CommentsBundle\EventListener\DataContainer\AddCommentFieldsListener
        arguments:
            - '%kernel.bundles%'

    contao_comments.security.calendar_comments_voter:
        class: Contao\CommentsBundle\Security\Voter\CalendarCommentsVoter
        arguments:
            - '@database_connection'
            - '@security.access.decision_manager'

    contao_comments.security.comments_access_voter:
        class: Contao\CommentsBundle\Security\Voter\CommentsAccessVoter
        arguments:
            - '@security.access.decision_manager'

    contao_comments.security.content_comments_voter:
        class: Contao\CommentsBundle\Security\Voter\ContentCommentsVoter
        arguments:
            - '@database_connection'
            - '@security.access.decision_manager'

    contao_comments.security.faq_comments_voter:
        class: Contao\CommentsBundle\Security\Voter\FaqCommentsVoter
        arguments:
            - '@security.access.decision_manager'

    contao_comments.security.legacy_hook_comments_voter:
        class: Contao\CommentsBundle\Security\Voter\LegacyHookCommentsVoter
        arguments:
            - '@contao.framework'
        tags:
            - { name: security.voter, priority: -100 }

    contao_comments.security.news_comments_voter:
        class: Contao\CommentsBundle\Security\Voter\NewsCommentsVoter
        arguments:
            - '@database_connection'
            - '@security.access.decision_manager'

    contao_comments.security.page_comments_voter:
        class: Contao\CommentsBundle\Security\Voter\PageCommentsVoter
        arguments:
            - '@database_connection'
            - '@security.access.decision_manager'
