From 03b8a85f98d335635e2beda2bdc062dcc2f77b91 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Wed, 19 Oct 2016 20:29:43 +0100
Subject: [PATCH] Don't try to install hubzilla in onion only

---
 src/freedombone-addremove | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/freedombone-addremove b/src/freedombone-addremove
index 92b5062f6..f8c8cf37b 100755
--- a/src/freedombone-addremove
+++ b/src/freedombone-addremove
@@ -77,6 +77,26 @@ function mark_unselected_apps_as_removed {
     done
 }
 
+function app_expected_to_not_be_installed {
+    # is the given application expected to be installed by default?
+    select_all_apps="$1"
+    app_name="$2"
+
+    read_config_param ONION_ONLY
+
+    if [[ "$select_all_apps" == "add-all" ]]; then
+        if [[ "$app_name" == "vim"  ]]; then
+            echo "1"
+            return
+        fi
+        if [[ $ONION_ONLY != 'no' && "$app_name" == "hubzilla"  ]]; then
+            echo "1"
+            return
+        fi
+    fi
+    echo "0"
+}
+
 function show_apps {
     select_all_apps=$1
     applist=""
@@ -87,7 +107,7 @@ function show_apps {
         if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
             applist="$applist $n $a off"
         else
-            if [[ "$a" == "vim" && "$select_all_apps" == "add-all" ]]; then
+            if [[ $(app_expected_to_not_be_installed) == "1" ]]; then
                 applist="$applist $n $a off"
             else
                 applist="$applist $n $a on"
-- 
GitLab