Merge pull request #2344 from thelounge/xpaw/client-guid
Replace client ids with guids
This commit is contained in:
commit
7d1af273d1
@ -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,
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user