diff --git a/core/file_base_filter.js b/core/file_base_filter.js index da6c4590..75938a26 100644 --- a/core/file_base_filter.js +++ b/core/file_base_filter.js @@ -2,7 +2,7 @@ 'use strict'; const _ = require('lodash'); -const uuids = require('node-uuid'); +const uuidV4 = require('uuid/v4'); module.exports = class FileBaseFilters { constructor(client) { @@ -37,7 +37,7 @@ module.exports = class FileBaseFilters { } add(filterInfo) { - const filterUuid = uuids.v4(); + const filterUuid = uuidV4(); filterInfo.tags = this.cleanTags(filterInfo.tags); @@ -110,7 +110,7 @@ module.exports = class FileBaseFilters { static getDefaultFilters() { const filters = {}; - const uuid = uuids.v4(); + const uuid = uuidV4(); filters[uuid] = { name : 'Default', areaTag : '', // all diff --git a/core/ftn_util.js b/core/ftn_util.js index 0860aeb4..c48cc222 100644 --- a/core/ftn_util.js +++ b/core/ftn_util.js @@ -8,7 +8,7 @@ let FNV1a = require('./fnv1a.js'); let _ = require('lodash'); let iconv = require('iconv-lite'); let moment = require('moment'); -let uuid = require('node-uuid'); +//let uuid = require('node-uuid'); let os = require('os'); let packageJson = require('../package.json'); @@ -39,7 +39,7 @@ exports.getQuotePrefix = getQuotePrefix; // Namespace for RFC-4122 name based UUIDs generated from // FTN kludges MSGID + AREA // -const ENIGMA_FTN_MSGID_NAMESPACE = uuid.parse('a5c7ae11-420c-4469-a116-0e9a6d8d2654'); +//const ENIGMA_FTN_MSGID_NAMESPACE = uuid.parse('a5c7ae11-420c-4469-a116-0e9a6d8d2654'); // See list here: https://github.com/Mithgol/node-fidonet-jam diff --git a/core/message.js b/core/message.js index ce6a7c8f..19d13e61 100644 --- a/core/message.js +++ b/core/message.js @@ -8,7 +8,7 @@ const createNamedUUID = require('./uuid_util.js').createNamedUUID; const getISOTimestampString = require('./database.js').getISOTimestampString; // deps -const uuid = require('node-uuid'); +const uuidParse = require('uuid-parse'); const async = require('async'); const _ = require('lodash'); const assert = require('assert'); @@ -17,7 +17,7 @@ const iconvEncode = require('iconv-lite').encode; module.exports = Message; -const ENIGMA_MESSAGE_UUID_NAMESPACE = uuid.parse('154506df-1df8-46b9-98f8-ebb5815baaf8'); +const ENIGMA_MESSAGE_UUID_NAMESPACE = uuidParse.parse('154506df-1df8-46b9-98f8-ebb5815baaf8'); function Message(options) { options = options || {}; @@ -135,7 +135,7 @@ Message.createMessageUUID = function(areaTag, modTimestamp, subject, body) { subject = iconvEncode(subject.toUpperCase().trim(), 'CP437'); body = iconvEncode(body.replace(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g, '').trim(), 'CP437'); - return uuid.unparse(createNamedUUID(ENIGMA_MESSAGE_UUID_NAMESPACE, Buffer.concat( [ areaTag, modTimestamp, subject, body ] ))); + return uuidParse.unparse(createNamedUUID(ENIGMA_MESSAGE_UUID_NAMESPACE, Buffer.concat( [ areaTag, modTimestamp, subject, body ] ))); }; Message.getMessageIdByUuid = function(uuid, cb) { diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index 856722b5..9288479d 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -23,7 +23,7 @@ const assert = require('assert'); const gaze = require('gaze'); const fse = require('fs-extra'); const iconv = require('iconv-lite'); -const uuid = require('node-uuid'); +const uuidV4 = require('uuid/v4'); exports.moduleInfo = { name : 'FTN BSO', @@ -834,7 +834,7 @@ function FTNMessageScanTossModule() { // if(Config.messageNetworks.ftn.areas[localAreaTag].allowDupes) { // just generate a UUID & therefor always allow for dupes - message.uuid = uuid.v1(); + message.uuid = uuidV4(); } callback(null); diff --git a/mods/telnet_bridge.js b/mods/telnet_bridge.js index b70b4589..1dbb1ae9 100644 --- a/mods/telnet_bridge.js +++ b/mods/telnet_bridge.js @@ -49,7 +49,9 @@ class TelnetClientConnection extends EventEmitter { // client may have bailed if(_.has(this, 'client.term.output')) { - this.client.term.output.unpipe(this.bridgeConnection); + if(this.bridgeConnection) { + this.client.term.output.unpipe(this.bridgeConnection); + } this.client.term.output.resume(); } } diff --git a/package.json b/package.json index 86a61a6c..dac2e394 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "mime-types": "^2.1.12", "minimist": "1.2.x", "moment": "^2.11.0", - "node-uuid": "^1.4.7", + "uuid": "^3.0.1", + "uuid-parse" : "^1.0.0", "ptyw.js": "NuSkooler/ptyw.js", "sqlite3": "^3.1.1", "ssh2": "^0.5.1",