diff --git a/core/connect.js b/core/connect.js index 5d45eaa4..52ff67a0 100644 --- a/core/connect.js +++ b/core/connect.js @@ -112,7 +112,6 @@ function ansiAttemptDetectUTF8(client, cb) { } } return cb(null); - } }; diff --git a/core/file_base_area.js b/core/file_base_area.js index ec36c7ec..e3887b84 100644 --- a/core/file_base_area.js +++ b/core/file_base_area.js @@ -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... const decodedData = iconv.decode(data, 'cp437'); - fileEntry[descType] = sliceAtSauceMarker(decodedData, 0x1a); + fileEntry[descType] = sliceAtSauceMarker(decodedData); fileEntry[`${descType}Src`] = 'descFile'; return next(null); }); @@ -575,7 +575,7 @@ function populateFileEntryInfoFromFile(fileEntry, filePath, cb) { `${_.upperFirst(descType)} description command failed` ); } else { - stdout = (stdout || '').trim(); + stdout = stdout.trim(); if(stdout.length > 0) { const key = 'short' === descType ? 'desc' : 'descLong'; if('desc' === key) { diff --git a/core/message.js b/core/message.js index 26a3bf21..5291b82a 100644 --- a/core/message.js +++ b/core/message.js @@ -329,8 +329,8 @@ module.exports = class Message { appendWhereClause(`m.area_tag = "${Message.WellKnownAreaTags.Private}"`); appendWhereClause( `m.message_id IN ( - SELECT message_id - FROM message_meta + SELECT message_id + FROM message_meta WHERE meta_category = "System" AND meta_name = "${Message.SystemMetaNames.LocalToUserID}" AND meta_value = ${filter.privateTagUserId} )`); } else { @@ -619,7 +619,7 @@ module.exports = class Message { } 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 (?, ?, ?, ?);`); if(!_.isArray(value)) { @@ -840,7 +840,7 @@ module.exports = class Message { } else { const QUOTE_RE = /^ ((?:[A-Za-z0-9]{2}> )+(?:[A-Za-z0-9]{2}>)*) */; const quoted = []; - const input = _.trimEnd(this.message).replace(/\b/g, ''); + const input = _.trimEnd(this.message).replace(/\x08/g, ''); // find *last* tearline let tearLinePos = this.getTearLinePosition(input); diff --git a/core/servers/content/nntp.js b/core/servers/content/nntp.js index 9f7c5a13..237c0994 100644 --- a/core/servers/content/nntp.js +++ b/core/servers/content/nntp.js @@ -275,7 +275,7 @@ class NNTPServer extends NNTPServerBase { // const remoteFrom = _.get(message.meta, [ 'System', Message.SystemMetaNames.RemoteFromUser ]); 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; if(!message.replyToMsgId) { diff --git a/core/string_util.js b/core/string_util.js index 4f7741ae..fa9a9097 100644 --- a/core/string_util.js +++ b/core/string_util.js @@ -29,9 +29,11 @@ exports.isAnsiLine = isAnsiLine; exports.isFormattedLine = isFormattedLine; exports.splitTextAtTerms = splitTextAtTerms; -// :TODO: create Unicode verison of this -const VOWELS = [ 'a', 'e', 'i', 'o', 'u' ]; -VOWELS.concat(VOWELS.map(l => l.toUpperCase())); +// :TODO: create Unicode version of this +const VOWELS = [ + 'a', 'e', 'i', 'o', 'u', + 'A', 'E', 'I', 'O', 'U', +]; const SIMPLE_ELITE_MAP = { 'a' : '4', diff --git a/core/upload.js b/core/upload.js index 6eaff2ab..b451ac9a 100644 --- a/core/upload.js +++ b/core/upload.js @@ -387,13 +387,11 @@ exports.getModule = class UploadModule extends MenuModule { self.client.log.error( '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 + } else if(dst !== finalPath) + { + // name changed; adjust before persist + newEntry.fileName = paths.basename(finalPath); } self.client.log.debug('Moved upload to area', { path : finalPath } ); diff --git a/core/view_controller.js b/core/view_controller.js index 9c0ffe19..f51c307f 100644 --- a/core/view_controller.js +++ b/core/view_controller.js @@ -219,7 +219,7 @@ function ViewController(options) { break; default : - propValue = propValue = conf[propName]; + propValue = conf[propName]; break; } } else {