From d78556e8c5ade5b9b4e528145fb5cdc5e34a09f8 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 8 Feb 2025 16:35:58 +1100 Subject: [PATCH] Allow logging filenames in website mode as well --- cli/onionshare_cli/__init__.py | 1 + cli/onionshare_cli/mode_settings.py | 7 ++++++- cli/onionshare_cli/web/send_base_mode.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/onionshare_cli/__init__.py b/cli/onionshare_cli/__init__.py index 0efbaa65..0dffb493 100644 --- a/cli/onionshare_cli/__init__.py +++ b/cli/onionshare_cli/__init__.py @@ -268,6 +268,7 @@ def main(cwd=None): if custom_csp: mode_settings.set("website", "custom_csp", custom_csp) mode_settings.set("website", "disable_csp", False) + mode_settings.set("website", "log_filenames", log_filenames) else: # See what the persistent mode was mode = mode_settings.get("persistent", "mode") diff --git a/cli/onionshare_cli/mode_settings.py b/cli/onionshare_cli/mode_settings.py index 77d1d643..2d0a874b 100644 --- a/cli/onionshare_cli/mode_settings.py +++ b/cli/onionshare_cli/mode_settings.py @@ -59,7 +59,12 @@ class ModeSettings: "disable_text": False, "disable_files": False, }, - "website": {"disable_csp": False, "custom_csp": None, "filenames": []}, + "website": { + "disable_csp": False, + "custom_csp": None, + "log_filenames": False, + "filenames": [] + }, "chat": {}, } self._settings = {} diff --git a/cli/onionshare_cli/web/send_base_mode.py b/cli/onionshare_cli/web/send_base_mode.py index c91c95de..5d6af460 100644 --- a/cli/onionshare_cli/web/send_base_mode.py +++ b/cli/onionshare_cli/web/send_base_mode.py @@ -245,7 +245,7 @@ class SendBaseModeWeb: or self.common.platform == "Linux" or self.common.platform == "BSD" ): - if self.web.settings.get("share", "log_filenames"): + if self.web.settings.get(self.web.mode, "log_filenames"): filename_str = f"{path} - " else: filename_str = ""