From 1222bd3dfeef42948bbfab32c1ba15020f25c8ae Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Sun, 8 Jul 2018 11:45:42 +0100
Subject: [PATCH] Add blacklist module on upgrade

---
 src/freedombone-app-xmpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp
index 0edd4c7d0..eec1db0ea 100755
--- a/src/freedombone-app-xmpp
+++ b/src/freedombone-app-xmpp
@@ -464,6 +464,14 @@ function update_prosody_modules {
         sed -i '/"pep";/a "s2s_blacklist"; -- Block bad domains' /etc/prosody/prosody.cfg.lua
         sed -i 's|"s2s_blacklist";|  "s2s_blacklist";|g' /etc/prosody/prosody.cfg.lua
     fi
+    if ! grep -q "s2s_blacklist" /etc/prosody/prosody.cfg.lua; then
+        sed -i '/"pep";/a "s2s_blacklist"; -- Block bad domains' /etc/prosody/prosody.cfg.lua
+        sed -i '/"muc_limits";/a "s2s_blacklist";' /etc/prosody/prosody.cfg.lua
+        sed -i 's|"s2s_blacklist";|  "s2s_blacklist";|g' /etc/prosody/prosody.cfg.lua
+    fi
+    if ! grep -q "vcard_muc" /etc/prosody/prosody.cfg.lua; then
+        sed -i '/"mam_muc";/a "vcard_muc";' /etc/prosody/prosody.cfg.lua
+    fi
 
     if ! grep -q "block_strangers" /etc/prosody/conf.avail/xmpp.cfg.lua; then
         sed -i '/"pep";/a "block_strangers"; -- Dont allow messages from strangers' /etc/prosody/conf.avail/xmpp.cfg.lua
-- 
GitLab