浏览代码

Block xmpp messages from strangers to mitigate spam, but still allow contact requests

Bob Mottram 6 年前
父节点
当前提交
00288b26f8
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10
    0
      src/freedombone-app-xmpp

+ 10
- 0
src/freedombone-app-xmpp 查看文件

@@ -435,6 +435,15 @@ function update_prosody_modules {
435 435
         sed -i '/"pep";/a "omemo_all_access"; -- Fix for PEP with OMEMO' /etc/prosody/conf.avail/xmpp.cfg.lua
436 436
         sed -i 's|"omemo_all_access";|  "omemo_all_access";|g' /etc/prosody/conf.avail/xmpp.cfg.lua
437 437
     fi
438
+
439
+    if ! grep -q "block_strangers" /etc/prosody/conf.avail/xmpp.cfg.lua; then
440
+        sed -i '/"pep";/a "block_strangers"; -- Dont allow messages from strangers' /etc/prosody/conf.avail/xmpp.cfg.lua
441
+        sed -i 's|"block_strangers";|  "block_strangers";|g' /etc/prosody/conf.avail/xmpp.cfg.lua
442
+    fi
443
+    if ! grep -q "block_strangers" /etc/prosody/conf.avail/xmpp.cfg.lua; then
444
+        sed -i '/"pep";/a "block_strangers"; -- Dont allow messages from strangers' /etc/prosody/conf.avail/xmpp.cfg.lua
445
+        sed -i 's|"block_strangers";|  "block_strangers";|g' /etc/prosody/conf.avail/xmpp.cfg.lua
446
+    fi
438 447
 }
439 448
 
440 449
 function prosody_daemon_restart_script {
@@ -748,6 +757,7 @@ function xmpp_modules {
748 757
       echo '  "blocklist"; -- Privacy lists';
749 758
       echo '  "privacy_lists"; -- Privacy lists';
750 759
       echo '  "blocking"; -- Blocking command';
760
+      echo '  "block_strangers"; -- Dont allow messages from strangers';
751 761
       echo '  "roster"; -- Roster versioning';
752 762
       echo '  "offline_email"; -- If offline send to email';
753 763
       echo '  "offline"; -- Store offline messages';