Add private exported + sent mail cleanup to trimMessageAreasScheduledEvent() scheduled event

This commit is contained in:
Bryan Ashby 2018-01-14 13:52:40 -07:00
parent 011c863547
commit e7b0e4af30
4 changed files with 75 additions and 27 deletions

View file

@ -1884,7 +1884,11 @@ function FTNMessageScanTossModule() {
ORDER BY message_id;`
;
async.each(Object.keys(Config.messageNetworks.ftn.areas), (areaTag, nextArea) => {
// we shouldn't, but be sure we don't try to pick up private mail here
const areaTags = Object.keys(Config.messageNetworks.ftn.areas)
.filter(areaTag => Message.WellKnownAreaTags.Private !== areaTag);
async.each(areaTags, (areaTag, nextArea) => {
const areaConfig = Config.messageNetworks.ftn.areas[areaTag];
if(!this.isAreaConfigValid(areaConfig)) {
return nextArea();
@ -1948,10 +1952,10 @@ function FTNMessageScanTossModule() {
// Just like EchoMail, we additionally exclude messages with the System state_flags0
// which will be present for imported or already exported messages
//
// NOTE: If StateFlags0 starts to use additional bits, we'll likely need to check them here!
//
// :TODO: fill out the rest of the consts here
// :TODO: this statement is crazy ugly
// :TODO: this should really check for extenral "flavor" and not-already-exported state_flags0
const getNewUuidsSql =
`SELECT message_id, message_uuid
FROM message m