|
@@ -91,6 +91,7 @@ function getChannel(name){
|
|
|
if(!channel){
|
|
|
console.log('Creating channel '+name);
|
|
|
channel = new IRCchannel;
|
|
|
+ channel.setEvents(events);
|
|
|
channel.name = name;
|
|
|
channels.push(channel);
|
|
|
events.doEvent('channelCreate', channel);
|
|
@@ -112,6 +113,7 @@ function newUser(nick, distance, TS, ident, host, uid, account, umodes, vhost, c
|
|
|
}
|
|
|
console.log('Introducing user '+nick);
|
|
|
user = new IRCuser;
|
|
|
+ user.setEvents(events);
|
|
|
user.introduce(nick, distance, TS, ident, host, uid, account, umodes, vhost, cloakedHost, ip, realname, uplink);
|
|
|
users.push(user);
|
|
|
events.doEvent('userCreate', user);
|
|
@@ -124,6 +126,7 @@ function newServer(name, sid, desc, distance, uplink){
|
|
|
}
|
|
|
console.log('Introducing server '+name+' (SID='+sid+', uplink="'+uplink.name+'")');
|
|
|
server = new IRCserver;
|
|
|
+ server.setEvents(events);
|
|
|
server.introduce(name, sid, desc, distance, uplink);
|
|
|
servers.push(server);
|
|
|
events.doEvent('serverCreate', server);
|
|
@@ -228,6 +231,7 @@ var irc = {
|
|
|
'setConnection': function(host, port, protocol){
|
|
|
uplink = require('./protocol/' + protocol);
|
|
|
me = new IRCserver;
|
|
|
+ me.setEvents(events);
|
|
|
me.introduce('serwisy.pirc.pl', '11K', 'Serwisy', 0, null);
|
|
|
servers.push(me);
|
|
|
uplink.setHandlers({
|
|
@@ -263,6 +267,7 @@ var irc = {
|
|
|
},
|
|
|
'makeUser': function(nick, ident, host, realname){
|
|
|
var user = new IRCuser;
|
|
|
+ user.setEvents(events);
|
|
|
var uid = uplink.makeUid();
|
|
|
user.introduce(nick, 0, Math.floor(new Date() / 1000).toString(10), ident, host, uid, null, '+SoB'/*TODO*/, null, null, null, realname, me);
|
|
|
users.push(user);
|