2014-09-13 21:29:45 +00:00
|
|
|
var Msg = require("../../models/msg");
|
|
|
|
|
|
|
|
module.exports = function(irc, network) {
|
|
|
|
var client = this;
|
2016-03-07 21:09:42 +00:00
|
|
|
irc.on("registered", function(data) {
|
|
|
|
network.nick = data.nick;
|
2014-09-13 21:29:45 +00:00
|
|
|
var lobby = network.channels[0];
|
|
|
|
var msg = new Msg({
|
2016-03-07 21:09:42 +00:00
|
|
|
text: "You're now known as " + data.nick
|
2014-09-13 21:29:45 +00:00
|
|
|
});
|
2016-04-19 10:20:18 +00:00
|
|
|
lobby.pushMessage(client, msg);
|
2014-10-11 23:59:01 +00:00
|
|
|
client.save();
|
2014-09-25 23:51:53 +00:00
|
|
|
client.emit("nick", {
|
|
|
|
network: network.id,
|
2016-03-07 21:09:42 +00:00
|
|
|
nick: data.nick
|
2014-09-25 23:51:53 +00:00
|
|
|
});
|
2014-09-13 21:29:45 +00:00
|
|
|
});
|
|
|
|
};
|