Only export private messages if the user has elected to do so

This commit is contained in:
Bryan Ashby 2020-05-11 19:57:25 -06:00
parent 9174b7b710
commit a56546cf3f
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 9 additions and 5 deletions

View File

@ -307,12 +307,16 @@ exports.getModule = class MessageBaseQWKExport extends MenuModule {
}); });
}, },
err => { err => {
return callback(err); return callback(err, userExportAreas);
}); });
}, },
(callback) => { (userExportAreas, callback) => {
// private messages to current user // Private messages to current user if the user has
// :TODO: Only if user property has private area tag // elected to export private messages
if (!(userExportAreas.find(exportArea => exportArea.areaTag === Message.WellKnownAreaTags.Private))) {
return callback(null);
}
const filter = { const filter = {
resultType : 'id', resultType : 'id',
privateTagUserId : this.client.user.userId, 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 // :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" // 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),
} }
}); });