From 221bf8e4b8f5ef2fa99e349c6f8ca395c0e685ed Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 21 Mar 2021 20:05:06 +0000 Subject: [PATCH] Confirm post deletion --- desktop_client.py | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index b41e29766..913312973 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -1607,19 +1607,30 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str, screenreader, systemLanguage, espeak) else: - sayStr = 'Deleting post' - _sayCommand(sayStr, sayStr, - screenreader, + print('') + if postJsonObject['object'].get('summary'): + print(postJsonObject['object']['summary']) + print(postJsonObject['object']['content']) + print('') + sayStr = 'Confirm delete, yes or no?' + _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) - sessionrm = createSession(proxyType) - sendDeleteViaServer(baseDir, sessionrm, - nickname, password, - domain, port, - httpPrefix, - postJsonObject['id'], - cachedWebfingers, personCache, - False, __version__) - refreshTimeline = True + yesno = input() + if 'y' not in yesno.lower(): + sayStr = 'Deleting post' + _sayCommand(sayStr, sayStr, + screenreader, + systemLanguage, espeak) + sessionrm = createSession(proxyType) + sendDeleteViaServer(baseDir, sessionrm, + nickname, password, + domain, port, + httpPrefix, + postJsonObject['id'], + cachedWebfingers, + personCache, + False, __version__) + refreshTimeline = True print('') if refreshTimeline: