js(__DIR__.'/js/dist/forum.js') ->css(__DIR__.'/less/forum.less'), (new Extend\Formatter) ->configure(ConfigureMentions::class), function (Dispatcher $events, Factory $views) { $events->listen(WillSerializeData::class, Listener\FilterVisiblePosts::class); $events->subscribe(Listener\AddPostMentionedByRelationship::class); $events->listen(ConfigureNotificationTypes::class, function (ConfigureNotificationTypes $event) { $event->add(PostMentionedBlueprint::class, PostSerializer::class, ['alert']); $event->add(UserMentionedBlueprint::class, PostSerializer::class, ['alert']); }); $events->listen( [Posted::class, Restored::class, Revised::class], Listener\UpdateMentionsMetadataWhenVisible::class ); $events->listen( [Deleted::class, Hidden::class], Listener\UpdateMentionsMetadataWhenInvisible::class ); $events->listen(ConfigurePostsQuery::class, Listener\AddFilterByMentions::class); $events->listen(Rendering::class, Listener\FormatPostMentions::class); $events->listen(Rendering::class, Listener\FormatUserMentions::class); $views->addNamespace('flarum-mentions', __DIR__.'/views'); }, ];