From f390ea74e9d74a7379a8ea36e0dfa25888f8b37a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Mar 2021 20:52:35 +0000 Subject: [PATCH] Choose to send after message encryption --- notifications_client.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 0d2ccb428..7359764dc 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -307,13 +307,6 @@ def _notificationNewDM(session, toHandle: str, sayStr = 'You entered this direct message to ' + toHandle + ':' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) _sayCommand(newMessage, newMessage, screenreader, systemLanguage, espeak) - sayStr = 'Send this direct message, yes or no?' - _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) - yesno = input() - if 'y' not in yesno.lower(): - sayStr = 'Abandoning new direct message' - _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) - return ccUrl = None followersOnly = False attach = None @@ -342,13 +335,23 @@ def _notificationNewDM(session, toHandle: str, cipherText = \ pgpEncryptToActor(paddedMessage, toHandle) if not cipherText: - sayStr = toHandle + ' has no PGP public key' + sayStr = \ + toHandle + ' has no PGP public key. ' + \ + 'Your message will be sent in clear text' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) else: newMessage = cipherText sayStr = 'Message encrypted' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) + sayStr = 'Send this direct message, yes or no?' + _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) + yesno = input() + if 'y' not in yesno.lower(): + sayStr = 'Abandoning new direct message' + _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) + return + sayStr = 'Sending' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) if sendPostViaServer(__version__,