Skip to content
Snippets Groups Projects
Commit 5d888f2b authored by Bob Mottram's avatar Bob Mottram
Browse files

Add word filter to muc

parent f3229428
No related branches found
No related tags found
No related merge requests found
......@@ -697,6 +697,17 @@ function upgrade_xmpp {
xmpp_contact_info /etc/prosody/prosody.cfg.lua
xmpp_server_blacklist /etc/prosody/prosody.cfg.lua
# add word filter to muc
if ! grep -q '"filter_words"' /etc/prosody/prosody.cfg.lua; then
sed -i '/"muc_limits"/a "filter_words";' /etc/prosody/prosody.cfg.lua
sed -i 's|"filter_words"| "filter_words"|g' /etc/prosody/prosody.cfg.lua
xmpp_restart=1
fi
if ! grep -q 'filter_words =' /etc/prosody/prosody.cfg.lua; then
echo 'filter_words = {}' >> /etc/prosody/prosody.cfg.lua
xmpp_restart=1
fi
# remove muc logging
if grep -q '"muc_log"' /etc/prosody/prosody.cfg.lua; then
sed -i '/"muc_log"/d' /etc/prosody/prosody.cfg.lua
......@@ -1258,6 +1269,7 @@ function xmpp_create_config {
echo ' name = "Chatrooms"';
echo ' modules_enabled = {';
echo ' "muc_limits";';
echo ' "filter_words";';
echo ' "muc_block_pm";';
echo ' "tls";';
echo ' "vcard_muc";';
......@@ -1277,6 +1289,7 @@ function xmpp_create_config {
echo " }"; } >> /etc/prosody/prosody.cfg.lua
fi
{ echo 'storage = { muc_log = "sql"; }';
echo 'filter_words = {}';
echo 'sql = { driver = "SQLite3", database = "prosody.sqlite" }';
echo 'muc_event_rate = 0.5;';
echo 'muc_burst_factor = 10;';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment