generated from discourse/discourse-plugin-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin.rb
30 lines (21 loc) · 781 Bytes
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true
# name: discourse-belgium-censor
# about: Replace bad words with "belgium"
# version: 1.0.0
# authors: Revolutionary Games Studio
# url: https://github.com/Revolutionary-Games/discourse-belgium-censor
# required_version: 2.7.0
enabled_site_setting :plugin_belgium_censor_enabled
module ::BelgiumCensorPluginModule
PLUGIN_NAME = "discourse-belgium-censor"
end
require_relative "lib/belgium_censor/engine"
after_initialize do
# Code which should run after Rails has finished booting
require_relative "lib/belgium_censor/censor"
censor = BelgiumCensorPluginModule::Censor.new
Plugin::Filter.register(:after_post_cook) do |_, cooked|
return cooked unless SiteSetting.plugin_belgium_censor_enabled
censor.filter cooked
end
end