Fix various minor mistakes
This commit is contained in:
parent
351ae52776
commit
c9ff904b2b
|
@ -112,7 +112,6 @@ function ansiAttemptDetectUTF8(client, cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cb(null);
|
return cb(null);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,7 @@ function extractAndProcessDescFiles(fileEntry, filePath, archiveEntries, cb) {
|
||||||
//
|
//
|
||||||
// :TODO: This isn't really always the case - how to handle this? We could do a quick detection...
|
// :TODO: This isn't really always the case - how to handle this? We could do a quick detection...
|
||||||
const decodedData = iconv.decode(data, 'cp437');
|
const decodedData = iconv.decode(data, 'cp437');
|
||||||
fileEntry[descType] = sliceAtSauceMarker(decodedData, 0x1a);
|
fileEntry[descType] = sliceAtSauceMarker(decodedData);
|
||||||
fileEntry[`${descType}Src`] = 'descFile';
|
fileEntry[`${descType}Src`] = 'descFile';
|
||||||
return next(null);
|
return next(null);
|
||||||
});
|
});
|
||||||
|
@ -575,7 +575,7 @@ function populateFileEntryInfoFromFile(fileEntry, filePath, cb) {
|
||||||
`${_.upperFirst(descType)} description command failed`
|
`${_.upperFirst(descType)} description command failed`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
stdout = (stdout || '').trim();
|
stdout = stdout.trim();
|
||||||
if(stdout.length > 0) {
|
if(stdout.length > 0) {
|
||||||
const key = 'short' === descType ? 'desc' : 'descLong';
|
const key = 'short' === descType ? 'desc' : 'descLong';
|
||||||
if('desc' === key) {
|
if('desc' === key) {
|
||||||
|
|
|
@ -329,8 +329,8 @@ module.exports = class Message {
|
||||||
appendWhereClause(`m.area_tag = "${Message.WellKnownAreaTags.Private}"`);
|
appendWhereClause(`m.area_tag = "${Message.WellKnownAreaTags.Private}"`);
|
||||||
appendWhereClause(
|
appendWhereClause(
|
||||||
`m.message_id IN (
|
`m.message_id IN (
|
||||||
SELECT message_id
|
SELECT message_id
|
||||||
FROM message_meta
|
FROM message_meta
|
||||||
WHERE meta_category = "System" AND meta_name = "${Message.SystemMetaNames.LocalToUserID}" AND meta_value = ${filter.privateTagUserId}
|
WHERE meta_category = "System" AND meta_name = "${Message.SystemMetaNames.LocalToUserID}" AND meta_value = ${filter.privateTagUserId}
|
||||||
)`);
|
)`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -619,7 +619,7 @@ module.exports = class Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
const metaStmt = transOrDb.prepare(
|
const metaStmt = transOrDb.prepare(
|
||||||
`INSERT INTO message_meta (message_id, meta_category, meta_name, meta_value)
|
`INSERT INTO message_meta (message_id, meta_category, meta_name, meta_value)
|
||||||
VALUES (?, ?, ?, ?);`);
|
VALUES (?, ?, ?, ?);`);
|
||||||
|
|
||||||
if(!_.isArray(value)) {
|
if(!_.isArray(value)) {
|
||||||
|
@ -840,7 +840,7 @@ module.exports = class Message {
|
||||||
} else {
|
} else {
|
||||||
const QUOTE_RE = /^ ((?:[A-Za-z0-9]{2}> )+(?:[A-Za-z0-9]{2}>)*) */;
|
const QUOTE_RE = /^ ((?:[A-Za-z0-9]{2}> )+(?:[A-Za-z0-9]{2}>)*) */;
|
||||||
const quoted = [];
|
const quoted = [];
|
||||||
const input = _.trimEnd(this.message).replace(/\b/g, '');
|
const input = _.trimEnd(this.message).replace(/\x08/g, '');
|
||||||
|
|
||||||
// find *last* tearline
|
// find *last* tearline
|
||||||
let tearLinePos = this.getTearLinePosition(input);
|
let tearLinePos = this.getTearLinePosition(input);
|
||||||
|
|
|
@ -275,7 +275,7 @@ class NNTPServer extends NNTPServerBase {
|
||||||
//
|
//
|
||||||
const remoteFrom = _.get(message.meta, [ 'System', Message.SystemMetaNames.RemoteFromUser ]);
|
const remoteFrom = _.get(message.meta, [ 'System', Message.SystemMetaNames.RemoteFromUser ]);
|
||||||
message.nntpHeaders['X-FTN-From'] = remoteFrom ? `${fromName} <${remoteFrom}>` : fromName;
|
message.nntpHeaders['X-FTN-From'] = remoteFrom ? `${fromName} <${remoteFrom}>` : fromName;
|
||||||
const remoteTo = _.get(message.meta [ 'System', Message.SystemMetaNames.RemoteToUser ]);
|
const remoteTo = _.get(message.meta, [ 'System', Message.SystemMetaNames.RemoteToUser ]);
|
||||||
message.nntpHeaders['X-FTN-To'] = remoteTo ? `${toName} <${remoteTo}>` : toName;
|
message.nntpHeaders['X-FTN-To'] = remoteTo ? `${toName} <${remoteTo}>` : toName;
|
||||||
|
|
||||||
if(!message.replyToMsgId) {
|
if(!message.replyToMsgId) {
|
||||||
|
|
|
@ -29,9 +29,11 @@ exports.isAnsiLine = isAnsiLine;
|
||||||
exports.isFormattedLine = isFormattedLine;
|
exports.isFormattedLine = isFormattedLine;
|
||||||
exports.splitTextAtTerms = splitTextAtTerms;
|
exports.splitTextAtTerms = splitTextAtTerms;
|
||||||
|
|
||||||
// :TODO: create Unicode verison of this
|
// :TODO: create Unicode version of this
|
||||||
const VOWELS = [ 'a', 'e', 'i', 'o', 'u' ];
|
const VOWELS = [
|
||||||
VOWELS.concat(VOWELS.map(l => l.toUpperCase()));
|
'a', 'e', 'i', 'o', 'u',
|
||||||
|
'A', 'E', 'I', 'O', 'U',
|
||||||
|
];
|
||||||
|
|
||||||
const SIMPLE_ELITE_MAP = {
|
const SIMPLE_ELITE_MAP = {
|
||||||
'a' : '4',
|
'a' : '4',
|
||||||
|
|
|
@ -387,13 +387,11 @@ exports.getModule = class UploadModule extends MenuModule {
|
||||||
self.client.log.error(
|
self.client.log.error(
|
||||||
'Failed moving physical upload file', { error : err.message, fileName : newEntry.fileName, source : src, dest : dst }
|
'Failed moving physical upload file', { error : err.message, fileName : newEntry.fileName, source : src, dest : dst }
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!err && dst !== finalPath) {
|
|
||||||
// name changed; ajust before persist
|
|
||||||
newEntry.fileName = paths.basename(finalPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
return nextEntry(null); // still try next file
|
return nextEntry(null); // still try next file
|
||||||
|
} else if(dst !== finalPath)
|
||||||
|
{
|
||||||
|
// name changed; adjust before persist
|
||||||
|
newEntry.fileName = paths.basename(finalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.client.log.debug('Moved upload to area', { path : finalPath } );
|
self.client.log.debug('Moved upload to area', { path : finalPath } );
|
||||||
|
|
|
@ -219,7 +219,7 @@ function ViewController(options) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
propValue = propValue = conf[propName];
|
propValue = conf[propName];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue