* Move to uuid vs node-uuid
* Use uuid-parse for to/from string
This commit is contained in:
parent
541489acb0
commit
690d148ad5
|
@ -2,7 +2,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const uuids = require('node-uuid');
|
const uuidV4 = require('uuid/v4');
|
||||||
|
|
||||||
module.exports = class FileBaseFilters {
|
module.exports = class FileBaseFilters {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
|
@ -37,7 +37,7 @@ module.exports = class FileBaseFilters {
|
||||||
}
|
}
|
||||||
|
|
||||||
add(filterInfo) {
|
add(filterInfo) {
|
||||||
const filterUuid = uuids.v4();
|
const filterUuid = uuidV4();
|
||||||
|
|
||||||
filterInfo.tags = this.cleanTags(filterInfo.tags);
|
filterInfo.tags = this.cleanTags(filterInfo.tags);
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ module.exports = class FileBaseFilters {
|
||||||
static getDefaultFilters() {
|
static getDefaultFilters() {
|
||||||
const filters = {};
|
const filters = {};
|
||||||
|
|
||||||
const uuid = uuids.v4();
|
const uuid = uuidV4();
|
||||||
filters[uuid] = {
|
filters[uuid] = {
|
||||||
name : 'Default',
|
name : 'Default',
|
||||||
areaTag : '', // all
|
areaTag : '', // all
|
||||||
|
|
|
@ -8,7 +8,7 @@ let FNV1a = require('./fnv1a.js');
|
||||||
let _ = require('lodash');
|
let _ = require('lodash');
|
||||||
let iconv = require('iconv-lite');
|
let iconv = require('iconv-lite');
|
||||||
let moment = require('moment');
|
let moment = require('moment');
|
||||||
let uuid = require('node-uuid');
|
//let uuid = require('node-uuid');
|
||||||
let os = require('os');
|
let os = require('os');
|
||||||
|
|
||||||
let packageJson = require('../package.json');
|
let packageJson = require('../package.json');
|
||||||
|
@ -39,7 +39,7 @@ exports.getQuotePrefix = getQuotePrefix;
|
||||||
// Namespace for RFC-4122 name based UUIDs generated from
|
// Namespace for RFC-4122 name based UUIDs generated from
|
||||||
// FTN kludges MSGID + AREA
|
// 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
|
// See list here: https://github.com/Mithgol/node-fidonet-jam
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ const createNamedUUID = require('./uuid_util.js').createNamedUUID;
|
||||||
const getISOTimestampString = require('./database.js').getISOTimestampString;
|
const getISOTimestampString = require('./database.js').getISOTimestampString;
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
const uuid = require('node-uuid');
|
const uuidParse = require('uuid-parse');
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
@ -17,7 +17,7 @@ const iconvEncode = require('iconv-lite').encode;
|
||||||
|
|
||||||
module.exports = Message;
|
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) {
|
function Message(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
@ -135,7 +135,7 @@ Message.createMessageUUID = function(areaTag, modTimestamp, subject, body) {
|
||||||
subject = iconvEncode(subject.toUpperCase().trim(), 'CP437');
|
subject = iconvEncode(subject.toUpperCase().trim(), 'CP437');
|
||||||
body = iconvEncode(body.replace(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g, '').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) {
|
Message.getMessageIdByUuid = function(uuid, cb) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ const assert = require('assert');
|
||||||
const gaze = require('gaze');
|
const gaze = require('gaze');
|
||||||
const fse = require('fs-extra');
|
const fse = require('fs-extra');
|
||||||
const iconv = require('iconv-lite');
|
const iconv = require('iconv-lite');
|
||||||
const uuid = require('node-uuid');
|
const uuidV4 = require('uuid/v4');
|
||||||
|
|
||||||
exports.moduleInfo = {
|
exports.moduleInfo = {
|
||||||
name : 'FTN BSO',
|
name : 'FTN BSO',
|
||||||
|
@ -834,7 +834,7 @@ function FTNMessageScanTossModule() {
|
||||||
//
|
//
|
||||||
if(Config.messageNetworks.ftn.areas[localAreaTag].allowDupes) {
|
if(Config.messageNetworks.ftn.areas[localAreaTag].allowDupes) {
|
||||||
// just generate a UUID & therefor always allow for dupes
|
// just generate a UUID & therefor always allow for dupes
|
||||||
message.uuid = uuid.v1();
|
message.uuid = uuidV4();
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(null);
|
callback(null);
|
||||||
|
|
|
@ -49,7 +49,9 @@ class TelnetClientConnection extends EventEmitter {
|
||||||
|
|
||||||
// client may have bailed
|
// client may have bailed
|
||||||
if(_.has(this, 'client.term.output')) {
|
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();
|
this.client.term.output.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
"mime-types": "^2.1.12",
|
"mime-types": "^2.1.12",
|
||||||
"minimist": "1.2.x",
|
"minimist": "1.2.x",
|
||||||
"moment": "^2.11.0",
|
"moment": "^2.11.0",
|
||||||
"node-uuid": "^1.4.7",
|
"uuid": "^3.0.1",
|
||||||
|
"uuid-parse" : "^1.0.0",
|
||||||
"ptyw.js": "NuSkooler/ptyw.js",
|
"ptyw.js": "NuSkooler/ptyw.js",
|
||||||
"sqlite3": "^3.1.1",
|
"sqlite3": "^3.1.1",
|
||||||
"ssh2": "^0.5.1",
|
"ssh2": "^0.5.1",
|
||||||
|
|
Loading…
Reference in New Issue