From 6d515f7a604ffd58691ba7414d9672221a0ca801 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 29 Sep 2019 15:52:34 -0500 Subject: [PATCH] added notification config option --- onionr/notifier/__init__.py | 4 ++++ static-data/default_config.json | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/onionr/notifier/__init__.py b/onionr/notifier/__init__.py index 5fdc696f..bc131ff1 100644 --- a/onionr/notifier/__init__.py +++ b/onionr/notifier/__init__.py @@ -24,6 +24,10 @@ except ImportError: else: notifications_enabled = True +import config + +if not config.get('general.show_notifications', True): notifications_enabled = False + def notify(title: str = "Onionr", message: str = ""): """cross platform method to show a notification""" if not notifications_enabled: return diff --git a/static-data/default_config.json b/static-data/default_config.json index 31dda36c..89cd28a6 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -14,7 +14,8 @@ "public_key": "", "random_bind_ip": false, "use_bootstrap_list": true, - "store_plaintext_blocks": true + "store_plaintext_blocks": true, + "show_notifications": true }, "plugins": {