Skip to content

Commit

Permalink
Merge pull request thelounge#970 from thelounge/xpaw/fix-ident
Browse files Browse the repository at this point in the history
Fix variable shuffling around ident handler
  • Loading branch information
astorije authored Mar 18, 2017
2 parents f308cc7 + eae870f commit 42a2e38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/identification.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class Identification {
var address = server.address();
log.info(`Identd server available on ${colors.green(address.address + ":" + address.port)}`);

startedCallback();
startedCallback(this);
});
} else {
startedCallback();
startedCallback(this);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/plugins/irc-events/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var Helper = require("../../helper");

module.exports = function(irc, network) {
var client = this;
var identHandler = this.manager.identHandler;

network.channels[0].pushMessage(client, new Msg({
text: "Network created, connecting to " + network.host + ":" + network.port + "..."
Expand Down Expand Up @@ -65,12 +64,12 @@ module.exports = function(irc, network) {
let identSocketId;

irc.on("raw socket connected", function(socket) {
identSocketId = identHandler.addSocket(socket, client.name || network.username);
identSocketId = client.manager.identHandler.addSocket(socket, client.name || network.username);
});

irc.on("socket close", function() {
if (identSocketId > 0) {
identHandler.removeSocket(identSocketId);
client.manager.identHandler.removeSocket(identSocketId);
identSocketId = 0;
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var ldap = require("ldapjs");
var colors = require("colors/safe");
const Identification = require("./identification");

let identHandler = null;
var manager = null;
var authFunction = localAuth;

Expand Down Expand Up @@ -89,7 +88,7 @@ in ${config.public ? "public" : "private"} mode`);

manager = new ClientManager();

identHandler = new Identification(() => {
new Identification((identHandler) => {
manager.init(identHandler, sockets);
});
};
Expand Down

0 comments on commit 42a2e38

Please sign in to comment.