summaryrefslogtreecommitdiff
path: root/pkg/backend/bitmask.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/backend/bitmask.go')
-rw-r--r--pkg/backend/bitmask.go19
1 files changed, 15 insertions, 4 deletions
diff --git a/pkg/backend/bitmask.go b/pkg/backend/bitmask.go
index 07d27ea..8fd2367 100644
--- a/pkg/backend/bitmask.go
+++ b/pkg/backend/bitmask.go
@@ -5,6 +5,7 @@ import (
"os"
"0xacab.org/leap/bitmask-vpn/pkg/bitmask"
+ "0xacab.org/leap/bitmask-vpn/pkg/config"
)
func initializeBitmask() {
@@ -19,6 +20,7 @@ func initializeBitmask() {
log.Println("error: cannot initialize bitmask")
}
ctx.bm = b
+ ctx.cfg = config.ParseConfig()
}
func startVPN() {
@@ -36,16 +38,25 @@ func stopVPN() {
}
}
+func wantDonations() bool {
+ if config.AskForDonations == "true" {
+ return true
+ }
+ return false
+}
+
// initializeContext initializes an empty connStatus and assigns it to the
// global ctx holder. This is expected to be called only once, so the public
// api uses the sync.Once primitive to call this.
func initializeContext(provider, appName string) {
var st status = off
ctx = &connectionCtx{
- AppName: appName,
- Provider: provider,
- Donate: false,
- Status: st,
+ AppName: appName,
+ Provider: provider,
+ DonateURL: config.DonateURL,
+ AskForDonations: wantDonations(),
+ DonateDialog: false,
+ Status: st,
}
go trigger(OnStatusChanged)
initializeBitmask()