flarum-msteams-webhook/extend.php

45 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
use Flarum\Extend;
use SbpJm\FlarumMSTeamsWebhook\Console\TestTeamsUserCommand;
use SbpJm\FlarumMSTeamsWebhook\Listener\MirrorAlertsToTeams;
return [
(new Extend\Locales(__DIR__ . '/locale')),
// Admin UI (Settings etc.)
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
// Forum UI (User notification settings Teams checkbox)
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js'),
// CLI test command
(new Extend\Console())
->command(TestTeamsUserCommand::class),
// ✅ EINZIGER Notification-Hook (richtig für Flarum 1.8.x)
(new Extend\Notification())
->beforeSending(MirrorAlertsToTeams::class),
(new Extend\Notification())
->driver('teams', TeamsNotificationDriver::class, [
// Absichtlich leer: Teams ist nicht default-on,
// kann aber im Notification-Grid pro Zeile aktiviert werden.
]),
(new Extend\User())
->registerPreference('sbp-jm-msteams.enabled', 'boolval', false)
->registerPreference('sbp-jm-msteams.types.newPost', 'boolval', false)
->registerPreference('sbp-jm-msteams.types.postMentioned', 'boolval', false)
->registerPreference('sbp-jm-msteams.types.userMentioned', 'boolval', false),
];