From 0bd6eff877e6d010150c52cb1069b1cde467f723 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 17 Aug 2019 13:26:09 +0100 Subject: [PATCH] Copy queue file to destination --- inbox.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/inbox.py b/inbox.py index 3efa7bda5..9a7ccd63f 100644 --- a/inbox.py +++ b/inbox.py @@ -999,17 +999,18 @@ def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \ if debug: print('DEBUG: object capabilities passed') - print('copy from '+queueFilename+' to '+destinationFilename) + print('copy queue file from '+queueFilename+' to '+destinationFilename) + + if messageJson.get('postNickname'): + with open(destinationFilename, 'w+') as fp: + commentjson.dump(messageJson['post'], fp, indent=4, sort_keys=False) + else: + with open(destinationFilename, 'w+') as fp: + commentjson.dump(messageJson, fp, indent=4, sort_keys=False) if not os.path.isfile(destinationFilename): return False - if messageJson.get('postNickname'): - with open(destinationFilename, 'w') as fp: - commentjson.dump(messageJson['post'], fp, indent=4, sort_keys=False) - else: - with open(destinationFilename, 'w') as fp: - commentjson.dump(messageJson, fp, indent=4, sort_keys=False) return True def restoreQueueItems(baseDir: str,queue: []) -> None: