From 5c656e0c16c7cc3203b9fc84f74b49d09abe3fb7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 25 Apr 2018 15:05:23 +0100 Subject: [PATCH] Updating pleroma filtering scripts --- src/freedombone-app-pleroma | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index c9bb53df..16419f8c 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -108,6 +108,7 @@ function create_pleroma_blocklist { echo 'users_query="DELETE FROM users WHERE"'; echo 'websub_server_subscriptions_query="DELETE FROM websub_server_subscriptions WHERE"'; echo 'websub_server_subscriptions_updated='; + echo 'filter_str='; echo 'while read blocked; do'; echo " if [[ \"\$blocked\" == *\".\"* || \"\$blocked\" == *\"@\"* ]]; then"; echo " if [ \${#blocked} -gt 4 ]; then"; @@ -119,6 +120,13 @@ function create_pleroma_blocklist { echo " users_query=\"\${users_query} nickname ilike '%\${blocked}%'\""; echo ' objects_updated=1'; echo " if [[ \"\$blocked\" != *\"@\"* ]]; then"; + echo ' # Create a filter string for the pleroma configuration'; + echo " if [ \"\$filter_str\" ]; then"; + echo " filter_str=\"\${filter_str}, \\\"\$blocked\\\"\""; + echo ' else'; + echo " filter_str=\"\${blocked}\""; + echo ' fi'; + echo ''; echo " if ! grep -q \"127.0.0.1 \$blocked\" /etc/hosts; then"; echo " echo \"127.0.0.1 \$blocked\" >> /etc/hosts"; echo ' fi'; @@ -132,6 +140,19 @@ function create_pleroma_blocklist { echo ' fi'; echo 'done