From a56546cf3f7c6eff63e257ce33b0fd391b159795 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 11 May 2020 19:57:25 -0600 Subject: [PATCH] Only export private messages if the user has elected to do so --- core/message_base_qwk_export.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/message_base_qwk_export.js b/core/message_base_qwk_export.js index a6d86952..d8efcc1d 100644 --- a/core/message_base_qwk_export.js +++ b/core/message_base_qwk_export.js @@ -307,12 +307,16 @@ exports.getModule = class MessageBaseQWKExport extends MenuModule { }); }, err => { - return callback(err); + return callback(err, userExportAreas); }); }, - (callback) => { - // private messages to current user - // :TODO: Only if user property has private area tag + (userExportAreas, callback) => { + // Private messages to current user if the user has + // elected to export private messages + if (!(userExportAreas.find(exportArea => exportArea.areaTag === Message.WellKnownAreaTags.Private))) { + return callback(null); + } + const filter = { resultType : 'id', privateTagUserId : this.client.user.userId, @@ -352,7 +356,7 @@ exports.getModule = class MessageBaseQWKExport extends MenuModule { // :TODO: something like this: allow to override the displayed/downloaded as filename // separate from the actual on disk filename. E.g. we could always download as "ENIGMA.QWK" - visible_filename : paths.basename(packetInfo.path), + //visible_filename : paths.basename(packetInfo.path), } });