Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2016-03-28 19:59:18 -06:00
commit 0cdeda5a0a
3 changed files with 18 additions and 7 deletions

View File

@ -220,8 +220,8 @@ function getQuotePrefix(name) {
// http://ftsc.org/docs/fts-0004.001
//
function getOrigin(address) {
const origin = _.has(Config.messageNetworks.originName) ?
Config.messageNetworks.originName :
const origin = _.has(Config, 'messageNetworks.originLine') ?
Config.messageNetworks.originLine :
Config.general.boardName;
const addrStr = new Address(address).toString('5D');

View File

@ -734,7 +734,7 @@ function FTNMessageScanTossModule() {
}
Message.getMessageIdsByMetaValue('FtnKludge', 'MSGID', message.meta.FtnKludge.REPLY, (err, msgIds) => {
if(!err) {
if(msgIds && msgIds.length > 0) {
assert(1 === msgIds.length);
message.replyToMsgId = msgIds[0];
}
@ -874,10 +874,13 @@ function FTNMessageScanTossModule() {
},
function importPacketFiles(packetFiles, callback) {
let rejects = [];
async.each(packetFiles, (packetFile, nextFile) => {
async.eachSeries(packetFiles, (packetFile, nextFile) => {
self.importMessagesFromPacketFile(paths.join(importDir, packetFile), '', err => {
// :TODO: check err -- log / track rejects, etc.
if(err) {
Log.debug(
{ path : paths.join(importDir, packetFile), error : err.toString() },
'Failed to import packet file');
rejects.push(packetFile);
}
nextFile();
@ -920,7 +923,15 @@ function FTNMessageScanTossModule() {
},
function discoverBundles(callback) {
fs.readdir(importDir, (err, files) => {
files = files.filter(f => '.pkt' !== paths.extname(f));
// :TODO: Need to be explicit about files to attempt an extract, e.g. *.su?, *.mo?, ...
// :TODO: if we do much more of this, probably just use the glob module
//files = files.filter(f => '.pkt' !== paths.extname(f));
const bundleRegExp = /\.(su|mo|tu|we|th|fr|sa)[0-9A-Za-z]/;
files = files.filter(f => {
const fext = paths.extname(f);
return bundleRegExp.test(fext);
});
async.map(files, (file, transform) => {
const fullPath = paths.join(importDir, file);

Binary file not shown.