Merge pull request #2344 from thelounge/xpaw/client-guid

Replace client ids with guids
This commit is contained in:
Jérémie Astori 2018-04-11 00:13:30 -04:00 committed by GitHub
commit 7d1af273d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -11,10 +11,10 @@ const ircFramework = require("irc-framework");
const Helper = require("./helper"); const Helper = require("./helper");
const UAParser = require("ua-parser-js"); const UAParser = require("ua-parser-js");
const MessageStorage = require("./plugins/sqlite"); const MessageStorage = require("./plugins/sqlite");
const uuidv4 = require("uuid/v4");
module.exports = Client; module.exports = Client;
let id = 0;
const events = [ const events = [
"away", "away",
"connection", "connection",
@ -71,7 +71,7 @@ function Client(manager, name, config = {}) {
lastActiveChannel: -1, lastActiveChannel: -1,
attachedClients: {}, attachedClients: {},
config: config, config: config,
id: id++, id: uuidv4(),
name: name, name: name,
networks: [], networks: [],
sockets: manager.sockets, sockets: manager.sockets,

View File

@ -106,7 +106,7 @@ module.exports = function(irc, network) {
if (Helper.config.debug.ircFramework) { if (Helper.config.debug.ircFramework) {
irc.on("debug", function(message) { irc.on("debug", function(message) {
log.debug("[" + client.name + " (#" + client.id + ") on " + network.name + " (#" + network.id + ")]", message); log.debug("[" + client.name + " (" + client.id + ") on " + network.name + " (#" + network.id + ")]", message);
}); });
} }