From 0b10e71547f80a2f8da119534f7bb1f2fcf37ba7 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 14 Mar 2018 07:35:04 -0700 Subject: [PATCH] Add receive mode warning, and print notification for each upload, in CLI mode --- onionshare/__init__.py | 3 +++ onionshare/web.py | 3 +++ share/locale/en.json | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/onionshare/__init__.py b/onionshare/__init__.py index e3a17538..0d5156d8 100644 --- a/onionshare/__init__.py +++ b/onionshare/__init__.py @@ -162,6 +162,9 @@ def main(cwd=None): print('') if receive: + print(strings._('receive_mode_warning')) + print('') + if stealth: print(strings._("give_this_url_receive_stealth")) print('http://{0:s}/{1:s}'.format(app.onion_host, web.slug)) diff --git a/onionshare/web.py b/onionshare/web.py index be2d1a07..495e1364 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -305,6 +305,9 @@ class Web(object): valid = True self.common.log('Web', 'receive_routes', '/upload, uploaded {}, saving to {}'.format(f.filename, local_path)) + print('') + print(strings._('receive_mode_received_file').format(local_path)) + print('') f.save(local_path) # Note that flash strings are on English, and not translated, on purpose, diff --git a/share/locale/en.json b/share/locale/en.json index 3340afd4..214aa32f 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -158,5 +158,7 @@ "info_in_progress_downloads_tooltip": "{} download(s) in progress", "info_completed_downloads_tooltip": "{} download(s) completed", "error_cannot_create_downloads_dir": "Error creating downloads folder: {}", - "error_downloads_dir_not_writable": "The downloads folder isn't writable: {}" + "error_downloads_dir_not_writable": "The downloads folder isn't writable: {}", + "receive_mode_warning": "Warning: Some files can hack your computer if you open them! Only open files from people you trust, or if you know what you're doing.", + "receive_mode_received_file": "Received file: {}" }