rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var chan = chan_name.toUpperCase(); | chan = chan_name.toUpperCase(); | function IRCClient_do_part(chan_name) { if((chan_name[0] != "#") && (chan_name[0] != "&") && !this.parent) { this.numeric403(chan_name); return 0; } var chan = chan_name.toUpperCase(); if (Channels[chan] != undefined) { if (this.onchannel(chan)) { var str = "PART " + Channels[chan].nam; if (this.parent) this.bcast_to_channel(Channels[chan].nam, str, false); else this.bcast_to_channel(Channels[chan].nam, str, true); this.rmchan(Channels[chan]); if (chan_name[0] != "&") this.bcast_to_servers(str); } else if (!this.parent) { this.numeric442(chan_name); } } else if (!this.parent) { this.numeric403(chan_name); }} |
var str = "PART " + Channels[chan].nam; | str = "PART " + Channels[chan].nam; | function IRCClient_do_part(chan_name) { if((chan_name[0] != "#") && (chan_name[0] != "&") && !this.parent) { this.numeric403(chan_name); return 0; } var chan = chan_name.toUpperCase(); if (Channels[chan] != undefined) { if (this.onchannel(chan)) { var str = "PART " + Channels[chan].nam; if (this.parent) this.bcast_to_channel(Channels[chan].nam, str, false); else this.bcast_to_channel(Channels[chan].nam, str, true); this.rmchan(Channels[chan]); if (chan_name[0] != "&") this.bcast_to_servers(str); } else if (!this.parent) { this.numeric442(chan_name); } } else if (!this.parent) { this.numeric403(chan_name); }} |
chan = chan_name.toUpperCase(); | var chan = chan_name.toUpperCase(); | function IRCClient_do_part(chan_name) { if((chan_name[0] != "#") && (chan_name[0] != "&") && !this.parent) { this.numeric403(chan_name); return 0; } chan = chan_name.toUpperCase(); if (Channels[chan] != undefined) { if (this.onchannel(chan)) { str = "PART " + Channels[chan].nam; if (this.parent) this.bcast_to_channel(Channels[chan].nam, str, false); else this.bcast_to_channel(Channels[chan].nam, str, true); this.rmchan(Channels[chan]); if (chan_name[0] != "&") this.bcast_to_servers(str); } else if (!this.parent) { this.numeric442(chan_name); } } else if (!this.parent) { this.numeric403(chan_name); }} |
str = "PART " + Channels[chan].nam; | var str = "PART " + Channels[chan].nam; | function IRCClient_do_part(chan_name) { if((chan_name[0] != "#") && (chan_name[0] != "&") && !this.parent) { this.numeric403(chan_name); return 0; } chan = chan_name.toUpperCase(); if (Channels[chan] != undefined) { if (this.onchannel(chan)) { str = "PART " + Channels[chan].nam; if (this.parent) this.bcast_to_channel(Channels[chan].nam, str, false); else this.bcast_to_channel(Channels[chan].nam, str, true); this.rmchan(Channels[chan]); if (chan_name[0] != "&") this.bcast_to_servers(str); } else if (!this.parent) { this.numeric442(chan_name); } } else if (!this.parent) { this.numeric403(chan_name); }} |
if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); | if (KLines[kline].hostmask) { this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": this.numeric(241,"L <hostmask> * <servername> <maxdepth>"); break; case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var this_uptime=time() - server_uptime; var updays=Math.floor(this_uptime / 86400); if (updays) this_uptime %= 86400; var uphours=Math.floor(this_uptime/(60*60)); var upmins=(Math.floor(this_uptime/60))%60; var upsec=this_uptime%60; var str = format("Server Up %u days, %u:%02u:%02u", updays,uphours,upmins,upsec); this.numeric(242,":" + str); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
this.numeric(212,"<command> <count>"); | for (c in Profile) { var sm = Profile[c]; this.numeric(212, c + " " + sm.ticks + " " + sm.executions); } | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": this.numeric(241,"L <hostmask> * <servername> <maxdepth>"); break; case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var this_uptime=time() - server_uptime; var updays=Math.floor(this_uptime / 86400); if (updays) this_uptime %= 86400; var uphours=Math.floor(this_uptime/(60*60)); var upmins=(Math.floor(this_uptime/60))%60; var upsec=this_uptime%60; var str = format("Server Up %u days, %u:%02u:%02u", updays,uphours,upmins,upsec); this.numeric(242,":" + str); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
this.numeric(241,"L <hostmask> * <servername> <maxdepth>"); break; | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var this_uptime=time() - server_uptime; var updays=format("%lu",this_uptime / 86400); if (updays < 1) updays=0; var uphours=format("%lu",(this_uptime-(updays*86400))/3600); if (uphours < 1) uphours=0; var upmins=format("%02lu",((this_uptime-(updays*86400))-(uphours*3600))/60); if (upmins < 1) upmins=0; var upsec=format("%02lu",(((this_uptime-(updays*86400))-(uphours*3600))-(upmins*60))); if (upmins == "0") upmins = "00"; this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
|
var updays=format("%lu",this_uptime / 86400); if (updays < 1) updays=0; var uphours=format("%lu",(this_uptime-(updays*86400))/3600); if (uphours < 1) uphours=0; var upmins=format("%02lu",((this_uptime-(updays*86400))-(uphours*3600))/60); if (upmins < 1) upmins=0; var upsec=format("%02lu",(((this_uptime-(updays*86400))-(uphours*3600))-(upmins*60))); if (upmins == "0") upmins = "00"; this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); | var updays=Math.floor(this_uptime / 86400); if (updays) this_uptime %= 86400; var uphours=Math.floor(this_uptime/(60*60)); var upmins=(Math.floor(this_uptime/60))%60; var upsec=this_uptime%60; var str = format("Server Up %u days %u:%02u:%02u", updays,uphours,upmins,upsec); this.numeric(242,":" + str); | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": this.numeric(241,"L <hostmask> * <servername> <maxdepth>"); break; case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var this_uptime=time() - server_uptime; var updays=format("%lu",this_uptime / 86400); if (updays < 1) updays=0; var uphours=format("%lu",(this_uptime-(updays*86400))/3600); if (uphours < 1) uphours=0; var upmins=format("%02lu",((this_uptime-(updays*86400))-(uphours*3600))/60); if (upmins < 1) upmins=0; var upsec=format("%02lu",(((this_uptime-(updays*86400))-(uphours*3600))-(upmins*60))); if (upmins == "0") upmins = "00"; this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
var upsecs=time() - server_uptime; var updays=upsecs / 86400; | var this_uptime=time() - server_uptime; var updays=format("%lu",this_uptime / 86400); | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var upsecs=time() - server_uptime; var updays=upsecs / 86400; if (updays < 1) updays=0; var uphours=(upsecs-(updays*86400))/3600; if (uphours < 1) uphours=0; var upmins=((upsecs-(updays*86400))-(uphours*3600))/60; if (upmins < 1) upmins=0; var upsec=(((upsecs-(updays*86400))-(uphours*3600))-(upmins*60)); this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
var uphours=(upsecs-(updays*86400))/3600; | var uphours=format("%lu",(this_uptime-(updays*86400))/3600); | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var upsecs=time() - server_uptime; var updays=upsecs / 86400; if (updays < 1) updays=0; var uphours=(upsecs-(updays*86400))/3600; if (uphours < 1) uphours=0; var upmins=((upsecs-(updays*86400))-(uphours*3600))/60; if (upmins < 1) upmins=0; var upsec=(((upsecs-(updays*86400))-(uphours*3600))-(upmins*60)); this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
var upmins=((upsecs-(updays*86400))-(uphours*3600))/60; | var upmins=format("%02lu",((this_uptime-(updays*86400))-(uphours*3600))/60); | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var upsecs=time() - server_uptime; var updays=upsecs / 86400; if (updays < 1) updays=0; var uphours=(upsecs-(updays*86400))/3600; if (uphours < 1) uphours=0; var upmins=((upsecs-(updays*86400))-(uphours*3600))/60; if (upmins < 1) upmins=0; var upsec=(((upsecs-(updays*86400))-(uphours*3600))-(upmins*60)); this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
var upsec=(((upsecs-(updays*86400))-(uphours*3600))-(upmins*60)); | var upsec=format("%02lu",(((this_uptime-(updays*86400))-(uphours*3600))-(upmins*60))); if (upmins == "0") upmins = "00"; | function IRCClient_do_stats(statschar) { switch(statschar[0]) { case "C": case "c": var cline_port; for (cline in CLines) { if(CLines[cline].port) cline_port = CLines[cline].port; else cline_port = "*"; this.numeric(213,"C " + CLines[cline].host + " * " + CLines[cline].servername + " " + cline_port + " " + CLines[cline].ircclass); if (NLines[cline]) this.numeric(214,"N " + NLines[cline].host + " * " + NLines[cline].servername + " " + NLines[cline].flags + " " + NLines[cline].ircclass); } break; case "H": case "h": for (hl in HLines) { this.numeric(244,"H " + HLines[hl].allowedmask + " * " + HLines[hl].servername); } break; case "I": case "i": var my_port; for (iline in ILines) { if (!ILines[iline].port) my_port = "*"; else my_port = ILines[iline].port; this.numeric(215,"I " + ILines[iline].ipmask + " * " + ILines[iline].hostmask + " " + my_port + " " + ILines[iline].ircclass); } break; case "K": case "k": for (kline in KLines) { if(KLines[kline].hostmask) this.numeric(216, KLines[kline].type + " " + KLines[kline].hostmask + " * * :" + KLines[kline].reason); } break; case "L": case "l": this.numeric(211,"<linkname> <sendq> <sentmessages> <sentbytes> <receivedmessages> <receivedbytes> <timeopen>"); break; case "M": case "m": this.numeric(212,"<command> <count>"); break; case "O": case "o": for (oline in OLines) { this.numeric(243, "O " + OLines[oline].hostmask + " * " + OLines[oline].nick); } break; case "U": for (uline in ULines) { this.numeric(246, "U " + ULines[uline] + " * * 0 -1"); } break; case "u": var upsecs=time() - server_uptime; var updays=upsecs / 86400; if (updays < 1) updays=0; var uphours=(upsecs-(updays*86400))/3600; if (uphours < 1) uphours=0; var upmins=((upsecs-(updays*86400))-(uphours*3600))/60; if (upmins < 1) upmins=0; var upsec=(((upsecs-(updays*86400))-(uphours*3600))-(upmins*60)); this.numeric(242,":Server Up " + updays + " days " + uphours + ":" + upmins + ":" + upsec); break; case "Y": case "y": var yl; for (thisYL in YLines) { yl = YLines[thisYL]; this.numeric(218,"Y " + thisYL + " " + yl.pingfreq + " " + yl.connfreq + " " + yl.maxlinks + " " + yl.sendq); } break; default: break; } this.numeric(219, statschar[0] + " :End of /STATS Command.");} |
this.numeric200(target,Servers[nick.parent].nick); | this.numeric200(target,Servers[nick.parent.toLowerCase()].nick); | function IRCClient_do_trace(target) { var server; var nick; if (target.match(/[.]/)) { // probably a server server = searchbyserver(target); if (server == -1) { // we hunted ourselves // FIXME: What do these numbers mean? O_o? this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { this.numeric402(target); return 0; } } else { // user. nick = Users[target.toUpperCase()]; if (nick.local) { if (nick.mode&USERMODE_OPER) this.numeric204(nick); else this.numeric205(nick); } else if (nick) { nick.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,Servers[nick.parent].nick); return 0; } else { this.numeric402(target); return 0; } } this.numeric(262, target + " :End of /TRACE.");} |
var server; var nick; | var server = searchbyserver(target); | function IRCClient_do_trace(target) { var server; var nick; if (target.match(/[.]/)) { // probably a server server = searchbyserver(target); if (server == -1) { // we hunted ourselves // FIXME: What do these numbers mean? O_o? this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { this.numeric402(target); return 0; } } else { // user. nick = Users[target.toUpperCase()]; if (nick.local) { if (nick.mode&USERMODE_OPER) this.numeric204(nick); else this.numeric205(nick); } else if (nick) { nick.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,Servers[nick.parent.toLowerCase()].nick); return 0; } else { this.numeric402(target); return 0; } } this.numeric(262, target + " :End of /TRACE.");} |
if (target.match(/[.]/)) { server = searchbyserver(target); if (server == -1) { this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { | if (server == -1) { this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { var nick = Users[target.toUpperCase()]; if (!nick) { | function IRCClient_do_trace(target) { var server; var nick; if (target.match(/[.]/)) { // probably a server server = searchbyserver(target); if (server == -1) { // we hunted ourselves // FIXME: What do these numbers mean? O_o? this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { this.numeric402(target); return 0; } } else { // user. nick = Users[target.toUpperCase()]; if (nick.local) { if (nick.mode&USERMODE_OPER) this.numeric204(nick); else this.numeric205(nick); } else if (nick) { nick.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,Servers[nick.parent.toLowerCase()].nick); return 0; } else { this.numeric402(target); return 0; } } this.numeric(262, target + " :End of /TRACE.");} |
} } else { nick = Users[target.toUpperCase()]; if (nick.local) { | } else if (nick.local) { | function IRCClient_do_trace(target) { var server; var nick; if (target.match(/[.]/)) { // probably a server server = searchbyserver(target); if (server == -1) { // we hunted ourselves // FIXME: What do these numbers mean? O_o? this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { this.numeric402(target); return 0; } } else { // user. nick = Users[target.toUpperCase()]; if (nick.local) { if (nick.mode&USERMODE_OPER) this.numeric204(nick); else this.numeric205(nick); } else if (nick) { nick.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,Servers[nick.parent.toLowerCase()].nick); return 0; } else { this.numeric402(target); return 0; } } this.numeric(262, target + " :End of /TRACE.");} |
} else if (nick) { | } else { | function IRCClient_do_trace(target) { var server; var nick; if (target.match(/[.]/)) { // probably a server server = searchbyserver(target); if (server == -1) { // we hunted ourselves // FIXME: What do these numbers mean? O_o? this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { this.numeric402(target); return 0; } } else { // user. nick = Users[target.toUpperCase()]; if (nick.local) { if (nick.mode&USERMODE_OPER) this.numeric204(nick); else this.numeric205(nick); } else if (nick) { nick.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,Servers[nick.parent.toLowerCase()].nick); return 0; } else { this.numeric402(target); return 0; } } this.numeric(262, target + " :End of /TRACE.");} |
return 0; } else { this.numeric402(target); return 0; | function IRCClient_do_trace(target) { var server; var nick; if (target.match(/[.]/)) { // probably a server server = searchbyserver(target); if (server == -1) { // we hunted ourselves // FIXME: What do these numbers mean? O_o? this.numeric206("30","1","0",servername); this.trace_all_opers(); } else if (server) { server.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,server.nick); return 0; } else { this.numeric402(target); return 0; } } else { // user. nick = Users[target.toUpperCase()]; if (nick.local) { if (nick.mode&USERMODE_OPER) this.numeric204(nick); else this.numeric205(nick); } else if (nick) { nick.rawout(":" + this.nick + " TRACE " + target); this.numeric200(target,Servers[nick.parent.toLowerCase()].nick); return 0; } else { this.numeric402(target); return 0; } } this.numeric(262, target + " :End of /TRACE.");} |
|
this.numeric(334,":/WHO [+|-][acghimnosuCM] <args> <mask>"); | this.numeric(334,":/WHO [+|-][acghilmnostuCIM] <args> <mask>"); | function IRCClient_do_who_usage() { this.numeric(334,":/WHO [+|-][acghimnosuCM] <args> <mask>"); this.numeric(334,":The modes as above work exactly like channel modes."); this.numeric(334,":<mask> may be '*' or in nick!user@host notation."); this.numeric(334,":i.e. '/WHO +a *.ca' would match all away users from *.ca"); this.numeric(334,":No args/mask matches to everything by default."); this.numeric(334,":a : User is away."); this.numeric(334,":c <chan>: User is on <@+><#channel>, no wildcards. Can check +o/+v."); this.numeric(334,":g <rnam>: Check against realname field, wildcards allowed."); this.numeric(334,":h <host>: Check user's hostname, wildcards allowed."); this.numeric(334,":i <ip> : Check against IP address, wildcards allowed."); this.numeric(334,":l <clas>: User is a member of <clas> irc class as defined on a Y:Line."); this.numeric(334,":m <umde>: User has <umodes> set, -+ allowed."); this.numeric(334,":n <nick>: User's nickname matches <nick>, wildcards allowed."); this.numeric(334,":o : User is an IRC Operator."); this.numeric(334,":s <srvr>: User is on <server>, wildcards allowed."); this.numeric(334,":t <time>: User has been on for more than (+) or less than (-) <time> secs."); this.numeric(334,":u <user>: User's username field matches, wildcards allowed."); this.numeric(334,":C : Only display first channel that the user matches."); this.numeric(334,":I : Only return IP addresses (as opposed to hostnames.)"); this.numeric(334,":M : Only check against channels you're a member of."); this.numeric(315,"? :End of /WHO list. (Usage)");} |
this.numeric(334,":/WHO [+|-][acghimnosuCM] <args>"); | this.numeric(334,":/WHO [+|-][acghimnosuCM] <args> <mask>"); | function IRCClient_do_who_usage() { this.numeric(334,":/WHO [+|-][acghimnosuCM] <args>"); this.numeric(334,":The modes as above work exactly like channel modes."); this.numeric(334,":a : User is away."); this.numeric(334,":c <chan>: User is on <channel>, no wildcards."); this.numeric(334,":g <rnam>: Check against realname field, wildcards allowed."); this.numeric(334,":h <host>: Check user's hostname, wildcards allowed."); this.numeric(334,":i <ip> : Check against IP address, wildcards allowed."); this.numeric(334,":m <umde>: User has <umodes> set, -+ allowed."); this.numeric(334,":n <nick>: User's nickname matches <nick>, wildcards allowed."); this.numeric(334,":o : User is an IRC Operator."); this.numeric(334,":s <srvr>: User is on <server>, wildcards allowed."); this.numeric(334,":u <user>: User's username field matches, wildcards allowed."); this.numeric(334,":C : Only display first channel that the user matches."); this.numeric(334,":M : Only check against channels you're a member of."); this.numeric(315,"? :End of /WHO list. (Usage)");} |
this.numeric(334,":<mask> may be '*' or in nick!user@host notation."); this.numeric(334,":i.e. '/WHO +a *.ca' would match all away users from *.ca"); this.numeric(334,":No args/mask matches to everything by default."); | function IRCClient_do_who_usage() { this.numeric(334,":/WHO [+|-][acghimnosuCM] <args>"); this.numeric(334,":The modes as above work exactly like channel modes."); this.numeric(334,":a : User is away."); this.numeric(334,":c <chan>: User is on <channel>, no wildcards."); this.numeric(334,":g <rnam>: Check against realname field, wildcards allowed."); this.numeric(334,":h <host>: Check user's hostname, wildcards allowed."); this.numeric(334,":i <ip> : Check against IP address, wildcards allowed."); this.numeric(334,":m <umde>: User has <umodes> set, -+ allowed."); this.numeric(334,":n <nick>: User's nickname matches <nick>, wildcards allowed."); this.numeric(334,":o : User is an IRC Operator."); this.numeric(334,":s <srvr>: User is on <server>, wildcards allowed."); this.numeric(334,":u <user>: User's username field matches, wildcards allowed."); this.numeric(334,":C : Only display first channel that the user matches."); this.numeric(334,":M : Only check against channels you're a member of."); this.numeric(315,"? :End of /WHO list. (Usage)");} |
|
if (Channels[wi.channels[i]].ismode(wi.id,CHANLIST_OP)) | if (Channels[wi.channels[i]].ismode(wi.id,CHANMODE_OP)) | function IRCClient_do_whois(wi) { if (!wi) return 0; this.numeric(311, wi.nick + " " + wi.uprefix + " " + wi.hostname + " * :" + wi.realname); var userchans=""; for (i in wi.channels) { if(wi.channels[i] && (!(Channels[wi.channels[i]].mode&CHANMODE_SECRET || Channels[wi.channels[i]].mode&CHANMODE_PRIVATE) || this.onchannel(wi.channels[i]) || this.mode&USERMODE_OPER)) { if (userchans) userchans += " "; if (Channels[wi.channels[i]].ismode(wi.id,CHANLIST_OP)) userchans += "@"; else if (Channels[wi.channels[i]].ismode(wi.id,CHANLIST_VOICE)) userchans += "+"; userchans += Channels[wi.channels[i]].nam; } } if (userchans) this.numeric(319, wi.nick + " :" + userchans); if (wi.local) this.numeric(312, wi.nick + " " + servername + " :" + serverdesc); else { wi_server = searchbyserver(wi.servername); this.numeric(312, wi.nick + " " + wi_server.nick + " :" + wi_server.realname); } if (wi.mode&USERMODE_OPER) this.numeric(313, wi.nick + " :is an IRC operator."); if (wi.away) this.numeric(301, wi.nick + " :" + wi.away); if (wi.local) this.numeric(317, wi.nick + " " + (time() - wi.talkidle) + " " + wi.connecttime + " :seconds idle, signon time");} |
else if (Channels[wi.channels[i]].ismode(wi.id,CHANLIST_VOICE)) | else if (Channels[wi.channels[i]].ismode(wi.id,CHANMODE_VOICE)) | function IRCClient_do_whois(wi) { if (!wi) return 0; this.numeric(311, wi.nick + " " + wi.uprefix + " " + wi.hostname + " * :" + wi.realname); var userchans=""; for (i in wi.channels) { if(wi.channels[i] && (!(Channels[wi.channels[i]].mode&CHANMODE_SECRET || Channels[wi.channels[i]].mode&CHANMODE_PRIVATE) || this.onchannel(wi.channels[i]) || this.mode&USERMODE_OPER)) { if (userchans) userchans += " "; if (Channels[wi.channels[i]].ismode(wi.id,CHANLIST_OP)) userchans += "@"; else if (Channels[wi.channels[i]].ismode(wi.id,CHANLIST_VOICE)) userchans += "+"; userchans += Channels[wi.channels[i]].nam; } } if (userchans) this.numeric(319, wi.nick + " :" + userchans); if (wi.local) this.numeric(312, wi.nick + " " + servername + " :" + serverdesc); else { wi_server = searchbyserver(wi.servername); this.numeric(312, wi.nick + " " + wi_server.nick + " :" + wi_server.realname); } if (wi.mode&USERMODE_OPER) this.numeric(313, wi.nick + " :is an IRC operator."); if (wi.away) this.numeric(301, wi.nick + " :" + wi.away); if (wi.local) this.numeric(317, wi.nick + " " + (time() - wi.talkidle) + " " + wi.connecttime + " :seconds idle, signon time");} |
function IRCClient_finalize_server_connect(states) { | function IRCClient_finalize_server_connect(states,sendps) { | function IRCClient_finalize_server_connect(states) { hcc_counter++; gnotice("Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: " + states); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(IRC_match(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :" + states); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.info); this.synchronize();} |
if (!this.sentps) { | if (sendps) { | function IRCClient_finalize_server_connect(states) { hcc_counter++; gnotice("Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: " + states); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(IRC_match(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :" + states); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.info); this.synchronize();} |
this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); | this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.info); | function IRCClient_finalize_server_connect(states) { hcc_counter++; umode_notice(USERMODE_ROUTING,"Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: " + states); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(IRC_match(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :" + states); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize();} |
oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: " + states); | umode_notice(USERMODE_ROUTING,"Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: " + states); | function IRCClient_finalize_server_connect(states) { hcc_counter++; oper_notice("Routing","Link with " + this.nick + "[unknown@" + this.hostname + "] established, states: " + states); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); if (!this.sentps) { for (cl in CLines) { if(match_irc_mask(this.nick,CLines[cl].servername)) { this.rawout("PASS " + CLines[cl].password + " :" + states); break; } } this.rawout("CAPAB " + server_capab); this.rawout("SERVER " + servername + " 1 :" + serverdesc); } this.bcast_to_servers_raw(":" + servername + " SERVER " + this.nick + " 2 :" + this.realname); this.synchronize();} |
tmp_mode = "+"; | var tmp_mode = "+"; | function IRCClient_get_usermode() { tmp_mode = "+"; if (this.mode&USERMODE_INVISIBLE) tmp_mode += "i"; if (this.mode&USERMODE_OPER) tmp_mode += "o"; return tmp_mode;} |
function IRCClient_get_usermode() { | function IRCClient_get_usermode(bcast_modes) { | function IRCClient_get_usermode() { var tmp_mode = "+"; if (this.mode&USERMODE_INVISIBLE) tmp_mode += "i"; if (this.mode&USERMODE_OPER) tmp_mode += "o"; return tmp_mode;} |
if (this.mode&USERMODE_INVISIBLE) tmp_mode += "i"; if (this.mode&USERMODE_OPER) tmp_mode += "o"; | for (ch in USERMODE_CHAR) { if ((!bcast_modes || (bcast_modes && USERMODE_BCAST[ch])) && this.mode&USERMODE_CHAR[ch]) tmp_mode += ch; } | function IRCClient_get_usermode() { var tmp_mode = "+"; if (this.mode&USERMODE_INVISIBLE) tmp_mode += "i"; if (this.mode&USERMODE_OPER) tmp_mode += "o"; return tmp_mode;} |
if(this.parent) | if(this.local) | function IRCClient_global(target,type_str,send_str) { if (!target.match("[.]")) { this.numeric(413,target + " :No top-level domain specified."); return 0; } var domain_part = target.split('.'); if (domain_part[domain_part.length - 1].match("[?*]")) { this.numeric(414,target + " :Wildcard found in top-level domain."); return 0; } var global_mask = target.slice(1); var global_str = type_str + " " + target + " :" + send_str; for(globClient in Local_Users) { var Client = Local_Users[globClient]; if (target[0] == "#") var global_match = Client.hostname; else // assume $ var global_match = Client.servername; if (IRC_match(global_match,global_mask)) Client.originatorout(global_str,this); } global_str = ":" + this.nick + " " + global_str; if(this.parent) Servers[this.parent.toLowerCase()].bcast_to_servers_raw(global_str); else if (this.flags&OLINE_CAN_GGNOTICE) server_bcast_to_servers(global_str); return 1;} |
if(this.local) | if(this.local && this.parent) | function IRCClient_global(target,type_str,send_str) { if (!target.match("[.]")) { this.numeric(413,target + " :No top-level domain specified."); return 0; } var domain_part = target.split('.'); if (domain_part[domain_part.length - 1].match("[?*]")) { this.numeric(414,target + " :Wildcard found in top-level domain."); return 0; } var global_mask = target.slice(1); var global_str = type_str + " " + target + " :" + send_str; for(globClient in Local_Users) { var Client = Local_Users[globClient]; if (target[0] == "#") var global_match = Client.hostname; else // assume $ var global_match = Client.servername; if (IRC_match(global_match,global_mask)) Client.originatorout(global_str,this); } global_str = ":" + this.nick + " " + global_str; if(this.local) Servers[this.parent.toLowerCase()].bcast_to_servers_raw(global_str); else if (this.flags&OLINE_CAN_GGNOTICE) server_bcast_to_servers(global_str); return 1;} |
Servers[this.parent].bcast_to_servers_raw(global_str); | Servers[this.parent.toLowerCase()].bcast_to_servers_raw(global_str); | function IRCClient_global(target,type_str,send_str) { if (!target.match("[.]")) { this.numeric(413,target + " :No top-level domain specified."); return 0; } var domain_part = target.split('.'); if (domain_part[domain_part.length - 1].match("[?*]")) { this.numeric(414,target + " :Wildcard found in top-level domain."); return 0; } var global_mask = target.slice(1); var global_str = type_str + " " + target + " :" + send_str; for(globClient in Local_Users) { var Client = Local_Users[globClient]; if (target[0] == "#") var global_match = Client.hostname; else // assume $ var global_match = Client.servername; if (IRC_match(global_match,global_mask)) Client.originatorout(global_str,this); } global_str = ":" + this.nick + " " + global_str; if(this.parent) Servers[this.parent].bcast_to_servers_raw(global_str); else if (this.flags&OLINE_CAN_GGNOTICE) server_bcast_to_servers(global_str); return 1;} |
Servers[this.parent].bcast_to_servers_raw(":" + this.nick + | Servers[this.parent.toLowerCase()].bcast_to_servers_raw(":" + this.nick + | function IRCClient_globops(str) { var globops_bits = 0; globops_bits |= USERMODE_OPER; globops_bits |= USERMODE_GLOBOPS; umode_notice(globops_bits,"Global","from " + this.nick +": " + str); if (this.parent) Servers[this.parent].bcast_to_servers_raw(":" + this.nick + " GLOBOPS :" + str); else server_bcast_to_servers(":" + this.nick + " GLOBOPS :" + str);} |
this.numeric("253", "0 :unknown connection(s)."); | function IRCClient_lusers() { this.numeric("251", ":There are " + count_nicks() + " users and " + count_nicks(USERMODE_INVISIBLE) + " invisible on " + count_servers(true) + " servers."); this.numeric("252", count_nicks(USERMODE_OPER) + " :IRC operators online."); this.numeric("254", count_channels() + " :channels formed."); this.numeric("255", ":I have " + count_local_nicks() + " clients and " + count_servers(false) + " servers."); this.numeric("250", ":Highest connection count: " + hcc_total + " (" + hcc_users + " clients.)"); this.server_notice(hcc_counter + " clients have connected since " + strftime("%a %b %e %H:%M:%S %Y %Z",server_uptime));} |
|
this.numeric("251", ":There are " + true_array_len(Users) + " users and 0 invisible on " + true_array_len(Servers) + " servers."); this.numeric("252", "0 :IRC operators online."); this.numeric("253", "0 :unknown connection(s)."); this.numeric("254", true_array_len(Channels) + " :channels formed."); this.numeric("255", ":I have " + true_array_len(Local_Users) + " clients and " + true_array_len(Local_Servers) + " servers."); this.numeric("250", ":Highest connection count: " + hcc_total + " (" + hcc_users + " clients.)"); | this.numeric(251, ":There are " + num_noninvis_users() + " users and " + num_invis_users() + " invisible on " + true_array_len(Servers) + " servers."); this.numeric(252, num_opers() + " :IRC operators online."); var unknown_connections = true_array_len(Unregistered); if (unknown_connections) this.numeric(253, unknown_connections + " :unknown connection(s)."); this.numeric(254, true_array_len(Channels) + " :channels formed."); this.numeric(255, ":I have " + true_array_len(Local_Users) + " clients and " + true_array_len(Local_Servers) + " servers."); this.numeric(250, ":Highest connection count: " + hcc_total + " (" + hcc_users + " clients.)"); | function IRCClient_lusers() { // FIXME: calc invis clients this.numeric("251", ":There are " + true_array_len(Users) + " users and 0 invisible on " + true_array_len(Servers) + " servers."); // FIXME: calc total opers this.numeric("252", "0 :IRC operators online."); this.numeric("253", "0 :unknown connection(s)."); this.numeric("254", true_array_len(Channels) + " :channels formed."); this.numeric("255", ":I have " + true_array_len(Local_Users) + " clients and " + true_array_len(Local_Servers) + " servers."); this.numeric("250", ":Highest connection count: " + hcc_total + " (" + hcc_users + " clients.)"); this.server_notice(hcc_counter + " clients have connected since " + strftime("%a %b %e %H:%M:%S %Y %Z",server_uptime));} |
if (motd_file.exists==false) | if (motd_file.exists==false) { | function IRCClient_motd() { var motd_file = new File(system.text_dir + "ircmotd.txt"); if (motd_file.exists==false) this.numeric(422, ":MOTD file missing: " + motd_file.name); else if (motd_file.open("r")==false) this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); else { this.numeric(375, ":- " + servername + " Message of the Day -"); this.numeric(372, ":- " + strftime("%m/%d/%Y %H:%M",motd_file.date)); while (!motd_file.eof) { motd_line = motd_file.readln(); if (motd_line != null) this.numeric(372, ":- " + motd_line); } motd_file.close(); } this.numeric(376, ":End of /MOTD command.");} |
else if (motd_file.open("r")==false) this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); else { | } else if (motd_file.open("r")==false) { this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); } else { | function IRCClient_motd() { var motd_file = new File(system.text_dir + "ircmotd.txt"); if (motd_file.exists==false) this.numeric(422, ":MOTD file missing: " + motd_file.name); else if (motd_file.open("r")==false) this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); else { this.numeric(375, ":- " + servername + " Message of the Day -"); this.numeric(372, ":- " + strftime("%m/%d/%Y %H:%M",motd_file.date)); while (!motd_file.eof) { motd_line = motd_file.readln(); if (motd_line != null) this.numeric(372, ":- " + motd_line); } motd_file.close(); } this.numeric(376, ":End of /MOTD command.");} |
motd_file = new File(system.text_dir + "/ircmotd.txt"); | motd_file = new File(system.text_dir + "ircmotd.txt"); | function IRCClient_motd() { motd_file = new File(system.text_dir + "/ircmotd.txt"); if (motd_file.open("r")) { this.numeric(375, ":- " + servername + " Message of the Day -"); this.numeric(372, ":- " + strftime("%m/%d/%Y %H:%M",motd_file.date)); while (!motd_file.eof) { motd_line = motd_file.readln(); if (motd_line != null) this.numeric(372, ":- " + motd_line); } } else { this.numeric(422, ":MOTD file is missing."); } this.numeric(376, ":End of /MOTD command.");} |
umode_notice(USERMODE_SPY,"Spy","MOTD requested by " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.servername + "]"); | function IRCClient_motd() { umode_notice(USERMODE_SPY,"Spy","MOTD requested by " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.servername + "]"); var motd_file = new File(system.text_dir + "ircmotd.txt"); if (motd_file.exists==false) this.numeric(422, ":MOTD file missing: " + motd_file.name); else if (motd_file.open("r")==false) this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); else { this.numeric(375, ":- " + servername + " Message of the Day -"); this.numeric(372, ":- " + strftime("%m/%d/%Y %H:%M",motd_file.date)); while (!motd_file.eof) { motd_line = motd_file.readln(); if (motd_line != null) this.numeric(372, ":- " + motd_line); } motd_file.close(); } this.numeric(376, ":End of /MOTD command.");} |
|
this.numeric(422, ":MOTD error " + errno + " opening: " + motd_file.name); | this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); | function IRCClient_motd() { motd_file = new File(system.text_dir + "ircmotd.txt"); if (motd_file.exists==false) this.numeric(422, ":MOTD file missing: " + motd_file.name); else if (motd_file.open("r")==false) this.numeric(422, ":MOTD error " + errno + " opening: " + motd_file.name); else { this.numeric(375, ":- " + servername + " Message of the Day -"); this.numeric(372, ":- " + strftime("%m/%d/%Y %H:%M",motd_file.date)); while (!motd_file.eof) { motd_line = motd_file.readln(); if (motd_line != null) this.numeric(372, ":- " + motd_line); } motd_file.close(); } this.numeric(376, ":End of /MOTD command.");} |
motd_file = new File(system.text_dir + "ircmotd.txt"); | umode_notice(USERMODE_SPY,"Spy","MOTD requested by " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.servername + "]"); var motd_file = new File(system.text_dir + "ircmotd.txt"); | function IRCClient_motd() { motd_file = new File(system.text_dir + "ircmotd.txt"); if (motd_file.exists==false) this.numeric(422, ":MOTD file missing: " + motd_file.name); else if (motd_file.open("r")==false) this.numeric(424, ":MOTD error " + errno + " opening: " + motd_file.name); else { this.numeric(375, ":- " + servername + " Message of the Day -"); this.numeric(372, ":- " + strftime("%m/%d/%Y %H:%M",motd_file.date)); while (!motd_file.eof) { motd_line = motd_file.readln(); if (motd_line != null) this.numeric(372, ":- " + motd_line); } motd_file.close(); } this.numeric(376, ":End of /MOTD command.");} |
if (Channels[chan].ismode(Channel_user.id,CHANLIST_OP)) | if (Channels[chan].ismode(Channel_user.id,CHANMODE_OP)) | function IRCClient_names(chan) { var Channel_user; var numnicks=0; var tmp=""; for(thisChannel_user in Channels[chan].users) { Channel_user=Clients[Channels[chan].users[thisChannel_user]]; if (Channel_user.nick && (Channel_user.conntype != TYPE_SERVER) && ( !(Channel_user.mode&USERMODE_INVISIBLE) || (this.onchannel(chan)) ) ) { if (numnicks) tmp += " "; if (Channels[chan].ismode(Channel_user.id,CHANLIST_OP)) tmp += "@"; else if (Channels[chan].ismode(Channel_user.id,CHANLIST_VOICE)) tmp += "+"; tmp += Channel_user.nick; numnicks++; if (numnicks >= 59) { // dump what we've got, it's too much. this.numeric353(chan, tmp); numnicks=0; tmp=""; } } } if(numnicks) this.numeric353(chan, tmp);} |
else if (Channels[chan].ismode(Channel_user.id,CHANLIST_VOICE)) | else if (Channels[chan].ismode(Channel_user.id,CHANMODE_VOICE)) | function IRCClient_names(chan) { var Channel_user; var numnicks=0; var tmp=""; for(thisChannel_user in Channels[chan].users) { Channel_user=Clients[Channels[chan].users[thisChannel_user]]; if (Channel_user.nick && (Channel_user.conntype != TYPE_SERVER) && ( !(Channel_user.mode&USERMODE_INVISIBLE) || (this.onchannel(chan)) ) ) { if (numnicks) tmp += " "; if (Channels[chan].ismode(Channel_user.id,CHANLIST_OP)) tmp += "@"; else if (Channels[chan].ismode(Channel_user.id,CHANLIST_VOICE)) tmp += "+"; tmp += Channel_user.nick; numnicks++; if (numnicks >= 59) { // dump what we've got, it's too much. this.numeric353(chan, tmp); numnicks=0; tmp=""; } } } if(numnicks) this.numeric353(chan, tmp);} |
numnicks=0; tmp=""; | var Channel_user; var numnicks=0; var tmp=""; | function IRCClient_names(chan) { numnicks=0; tmp=""; for(thisChannel_user in Channels[chan].users) { Channel_user=Clients[Channels[chan].users[thisChannel_user]]; if (Channel_user.nick && (Channel_user.conntype != TYPE_SERVER) && ( !(Channel_user.mode&USERMODE_INVISIBLE) || (this.onchannel(chan)) ) ) { if (numnicks) tmp += " "; if (Channels[chan].ismode(Channel_user.id,CHANLIST_OP)) tmp += "@"; else if (Channels[chan].ismode(Channel_user.id,CHANLIST_VOICE)) tmp += "+"; tmp += Channel_user.nick; numnicks++; if (numnicks >= 59) { // dump what we've got, it's too much. this.numeric353(chan, tmp); numnicks=0; tmp=""; } } } if(numnicks) this.numeric353(chan, tmp);} |
if (Users[sqclient].servername == this.nick) | if (Users[sqclient] && (Users[sqclient].servername == this.nick) ) | function IRCClient_netsplit(ns_reason) { if (!ns_reason) ns_reason = "net.split.net.split net.split.net.split"; for (sqclient in Users) { if (Users[sqclient].servername == this.nick) Users[sqclient].quit(ns_reason,true,true); }} |
for (sqserver in Servers) { if (Servers[sqserver] && (Servers[sqserver].linkparent == this.nick) ) Servers[sqserver].quit(ns_reason,true,true); } | function IRCClient_netsplit(ns_reason) { if (!ns_reason) ns_reason = "net.split.net.split net.split.net.split"; for (sqclient in Users) { if (Users[sqclient].servername == this.nick) Users[sqclient].quit(ns_reason,true,true); }} |
|
Clients[sqclient].quit(ns_reason,false); | Clients[sqclient].quit(ns_reason,true,true); | function IRCClient_netsplit(ns_reason) { if (!ns_reason) ns_reason = "net.split.net.split net.split.net.split"; for (sqclient in Clients) { if (Clients[sqclient] && (Clients[sqclient] != null) && (Clients[sqclient] != undefined)) { if ((Clients[sqclient].servername == this.nick) || (Clients[sqclient].linkparent == this.nick)) Clients[sqclient].quit(ns_reason,false); } }} |
uchan_counter=0; | var uchan_counter=0; | function IRCClient_num_channels_on() { uchan_counter=0; for(tmp_uchan in this.channels) { if (this.channels[tmp_uchan]) uchan_counter++; } return uchan_counter;} |
function IRCClient_numeric322(chan) { | function IRCClient_numeric322(chan,show_modes) { | function IRCClient_numeric322(chan) { var channel_name; if ((chan.mode&CHANMODE_PRIVATE) && !(this.mode&USERMODE_OPER) && !this.onchannel(chan.nam.toUpperCase) ) channel_name = "Priv"; else channel_name = chan.nam; if (!(chan.mode&CHANMODE_SECRET) || (this.mode&USERMODE_OPER) || this.onchannel(chan.nam.toUpperCase()) ) this.numeric(322, channel_name + " " + chan.count_users() + " :" + chan.topic);} |
!this.onchannel(chan.nam.toUpperCase) ) | !this.onchannel(chan.nam.toUpperCase) ) { | function IRCClient_numeric322(chan) { var channel_name; if ((chan.mode&CHANMODE_PRIVATE) && !(this.mode&USERMODE_OPER) && !this.onchannel(chan.nam.toUpperCase) ) channel_name = "Priv"; else channel_name = chan.nam; if (!(chan.mode&CHANMODE_SECRET) || (this.mode&USERMODE_OPER) || this.onchannel(chan.nam.toUpperCase()) ) this.numeric(322, channel_name + " " + chan.count_users() + " :" + chan.topic);} |
else | } else { | function IRCClient_numeric322(chan) { var channel_name; if ((chan.mode&CHANMODE_PRIVATE) && !(this.mode&USERMODE_OPER) && !this.onchannel(chan.nam.toUpperCase) ) channel_name = "Priv"; else channel_name = chan.nam; if (!(chan.mode&CHANMODE_SECRET) || (this.mode&USERMODE_OPER) || this.onchannel(chan.nam.toUpperCase()) ) this.numeric(322, channel_name + " " + chan.count_users() + " :" + chan.topic);} |
if (disp_topic) disp_topic += " "; disp_topic += chan.topic; } | function IRCClient_numeric322(chan) { var channel_name; if ((chan.mode&CHANMODE_PRIVATE) && !(this.mode&USERMODE_OPER) && !this.onchannel(chan.nam.toUpperCase) ) channel_name = "Priv"; else channel_name = chan.nam; if (!(chan.mode&CHANMODE_SECRET) || (this.mode&USERMODE_OPER) || this.onchannel(chan.nam.toUpperCase()) ) this.numeric(322, channel_name + " " + chan.count_users() + " :" + chan.topic);} |
|
this.numeric(322, channel_name + " " + chan.count_users() + " :" + chan.topic); | this.numeric(322, channel_name + " " + chan.count_users() + " :" + disp_topic); | function IRCClient_numeric322(chan) { var channel_name; if ((chan.mode&CHANMODE_PRIVATE) && !(this.mode&USERMODE_OPER) && !this.onchannel(chan.nam.toUpperCase) ) channel_name = "Priv"; else channel_name = chan.nam; if (!(chan.mode&CHANMODE_SECRET) || (this.mode&USERMODE_OPER) || this.onchannel(chan.nam.toUpperCase()) ) this.numeric(322, channel_name + " " + chan.count_users() + " :" + chan.topic);} |
!this.onchannel(chan.nam.toUpperCase) ) { | !this.onchannel(chan.nam.toUpperCase()) ) { | function IRCClient_numeric322(chan,show_modes) { var channel_name; var disp_topic = ""; if (show_modes) { var chanm = chan.chanmode() disp_topic += "[" + chanm.slice(0,chanm.length-1) + "]" } if ((chan.mode&CHANMODE_PRIVATE) && !(this.mode&USERMODE_OPER) && !this.onchannel(chan.nam.toUpperCase) ) { channel_name = "Priv"; } else { channel_name = chan.nam; if (disp_topic) disp_topic += " "; disp_topic += chan.topic; } if (!(chan.mode&CHANMODE_SECRET) || (this.mode&USERMODE_OPER) || this.onchannel(chan.nam.toUpperCase()) ) this.numeric(322, channel_name + " " + chan.count_users() + " :" + disp_topic);} |
this.numeric(351, version + " " + servername + " :Synchronet IRC Daemon by Randy Sommerfeld <[email protected]>"); | this.numeric(351, VERSION + " " + servername + " :(REV:" + REVISION + ") " + VERSION_STR); | function IRCClient_numeric351() { this.numeric(351, version + " " + servername + " :Synchronet IRC Daemon by Randy Sommerfeld <[email protected]>");} |
this.numeric(351, VERSION + " " + servername + " :(REV:" + REVISION + ") " + VERSION_STR); | this.numeric(351, VERSION + " " + servername + " :" + VERSION_STR); | function IRCClient_numeric351() { this.numeric(351, VERSION + " " + servername + " :(REV:" + REVISION + ") " + VERSION_STR);} |
if (chan.ismode(user.id,CHANLIST_OP)) | if (chan.ismode(user.id,CHANMODE_OP)) | function IRCClient_numeric352(user,show_ips_only,chan) { var who_mode=""; var disp; var disphost; if (!chan) disp = "*"; else disp = chan.nam; if (user.away) who_mode += "G"; else who_mode += "H"; if (chan) { if (chan.ismode(user.id,CHANLIST_OP)) who_mode += "@"; else if (chan.ismode(user.id,CHANLIST_VOICE)) who_mode += "+"; } if (user.mode&USERMODE_OPER) who_mode += "*"; if (show_ips_only) disphost = user.ip; else disphost = user.hostname; this.numeric(352, disp + " " + user.uprefix + " " + disphost + " " + user.servername + " " + user.nick + " " + who_mode + " :" + user.hops + " " + user.realname);} |
else if (chan.ismode(user.id,CHANLIST_VOICE)) | else if (chan.ismode(user.id,CHANMODE_VOICE)) | function IRCClient_numeric352(user,show_ips_only,chan) { var who_mode=""; var disp; var disphost; if (!chan) disp = "*"; else disp = chan.nam; if (user.away) who_mode += "G"; else who_mode += "H"; if (chan) { if (chan.ismode(user.id,CHANLIST_OP)) who_mode += "@"; else if (chan.ismode(user.id,CHANLIST_VOICE)) who_mode += "+"; } if (user.mode&USERMODE_OPER) who_mode += "*"; if (show_ips_only) disphost = user.ip; else disphost = user.hostname; this.numeric(352, disp + " " + user.uprefix + " " + disphost + " " + user.servername + " " + user.nick + " " + who_mode + " :" + user.hops + " " + user.realname);} |
if (!user) return 0; | function IRCClient_numeric352(user,show_ips_only,chan) { var who_mode=""; var disp; var disphost; if (!chan) disp = "*"; else disp = chan.nam; if (user.away) who_mode += "G"; else who_mode += "H"; if (chan) { if (chan.ismode(user.id,CHANMODE_OP)) who_mode += "@"; else if (chan.ismode(user.id,CHANMODE_VOICE)) who_mode += "+"; } if (user.mode&USERMODE_OPER) who_mode += "*"; if (show_ips_only) disphost = user.ip; else disphost = user.hostname; this.numeric(352, disp + " " + user.uprefix + " " + disphost + " " + user.servername + " " + user.nick + " " + who_mode + " :" + user.hops + " " + user.realname);} |
|
ctype_str = "@"; | var ctype_str = "@"; | function IRCClient_numeric353(chan, str) { // = public @ secret * everything else if (Channels[chan].mode&CHANMODE_SECRET) ctype_str = "@"; else ctype_str = "="; this.numeric("353", ctype_str + " " + Channels[chan].nam + " :" + str);} |
ctype_str = "="; | var ctype_str = "="; | function IRCClient_numeric353(chan, str) { // = public @ secret * everything else if (Channels[chan].mode&CHANMODE_SECRET) ctype_str = "@"; else ctype_str = "="; this.numeric("353", ctype_str + " " + Channels[chan].nam + " :" + str);} |
this.numeric("481", ":Permission Denied. You do not have the correct IRC operator privileges."); | this.numeric("481", ":Permission Denied. " + "You do not have the correct IRC operator privileges."); | function IRCClient_numeric481() { this.numeric("481", ":Permission Denied. You do not have the correct IRC operator privileges.");} |
this.numeric("481", ":Permission Denied. You're not an IRC operator."); | this.numeric("481", ":Permission Denied. You do not have the correct IRC operator privileges."); | function IRCClient_numeric481() { this.numeric("481", ":Permission Denied. You're not an IRC operator.");} |
var partingChannel; | function IRCClient_part_all() { for(thisChannel in this.channels) { partingChannel=this.channels[thisChannel]; this.do_part(Channels[partingChannel].nam); }} |
|
this.do_part(Channels[partingChannel].nam); | this.do_part(partingChannel.nam); | function IRCClient_part_all() { var partingChannel; for(thisChannel in this.channels) { partingChannel=this.channels[thisChannel]; this.do_part(Channels[partingChannel].nam); }} |
server_wallops("Client Exiting: " + this.ircnuh + " (" + str + ")"); | oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.decip + "]"); | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { this.netsplit(servername + " " + this.nick); this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); } if((server.client_remove!=undefined) && (this.conntype > TYPE_UNREGISTERED)) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); server_wallops("Client Exiting: " + this.ircnuh + " (" + str + ")"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id]; delete this;} |
function IRCClient_Quit(str,do_bcast) { | function IRCClient_Quit(str,suppress_bcast,is_netsplit,origin) { var tmp; | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { if (this.local) this.netsplit(servername + " " + this.nick); else this.netsplit(str); } if((server.client_remove!=undefined) && !this.sentps) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id];} |
if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) | if (!suppress_bcast && (this.conntype > TYPE_UNREGISTERED) ) | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { if (this.local) this.netsplit(servername + " " + this.nick); else this.netsplit(str); } if((server.client_remove!=undefined) && !this.sentps) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id];} |
} else if (this.server) { if (this.local) this.netsplit(servername + " " + this.nick); else this.netsplit(str); | } else if (this.server && is_netsplit) { this.netsplit(str); } else if (this.server && this.local) { if (!suppress_bcast) this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); this.netsplit(servername + " " + this.nick); } else if (this.server && origin) { if (!suppress_bcast) this.bcast_to_servers_raw(":" + origin.nick + " SQUIT " + this.nick + " :" + str); this.netsplit(origin.nick + " " + this.nick); } else { oper_notice("Notice","Netspliting a server which isn't local and doesn't have an origin."); if (!suppress_bcast) this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); this.netsplit(); | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { if (this.local) this.netsplit(servername + " " + this.nick); else this.netsplit(str); } if((server.client_remove!=undefined) && !this.sentps) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id];} |
if((server.client_remove!=undefined) && !this.sentps) | if((server.client_remove!=undefined) && !this.sentps && this.local) | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { if (this.local) this.netsplit(servername + " " + this.nick); else this.netsplit(str); } if((server.client_remove!=undefined) && !this.sentps) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id];} |
oper_notice("Notice","Netspliting a server which isn't local and doesn't have an origin."); | umode_notice(USERMODE_OPER,"Notice", "Netspliting a server which isn't local and doesn't " + "have an origin?!"); | function IRCClient_Quit(str,suppress_bcast,is_netsplit,origin) { var tmp; if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (!suppress_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server && is_netsplit) { this.netsplit(str); } else if (this.server && this.local) { if (!suppress_bcast) this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); this.netsplit(servername + " " + this.nick); } else if (this.server && origin) { if (!suppress_bcast) this.bcast_to_servers_raw(":" + origin.nick + " SQUIT " + this.nick + " :" + str); this.netsplit(origin.nick + " " + this.nick); } else { // we should never land here oper_notice("Notice","Netspliting a server which isn't local and doesn't have an origin."); if (!suppress_bcast) this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); this.netsplit(); } if((server.client_remove!=undefined) && !this.sentps && this.local) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id];} |
oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); | umode_notice(USERMODE_CLIENT,"Client","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); | function IRCClient_Quit(str,suppress_bcast,is_netsplit,origin) { var tmp; if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (!suppress_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server && is_netsplit) { this.netsplit(str); } else if (this.server && this.local) { if (!suppress_bcast) this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); this.netsplit(servername + " " + this.nick); } else if (this.server && origin) { if (!suppress_bcast) this.bcast_to_servers_raw(":" + origin.nick + " SQUIT " + this.nick + " :" + str); this.netsplit(origin.nick + " " + this.nick); } else { // we should never land here oper_notice("Notice","Netspliting a server which isn't local and doesn't have an origin."); if (!suppress_bcast) this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); this.netsplit(); } if((server.client_remove!=undefined) && !this.sentps && this.local) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id];} |
this.netsplit(servername + " " + this.nick); this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); | if (this.local) this.netsplit(servername + " " + this.nick); else this.netsplit(str); | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { this.netsplit(servername + " " + this.nick); this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); } if((server.client_remove!=undefined) && (this.conntype > TYPE_UNREGISTERED)) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id]; delete this;} |
if((server.client_remove!=undefined) && (this.conntype > TYPE_UNREGISTERED)) | if((server.client_remove!=undefined) && !this.sentps) | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { this.netsplit(servername + " " + this.nick); this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); } if((server.client_remove!=undefined) && (this.conntype > TYPE_UNREGISTERED)) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id]; delete this;} |
delete this; | function IRCClient_Quit(str,do_bcast) { if (!str) str = this.nick; if (!this.server) { tmp = "QUIT :" + str; this.bcast_to_uchans_unique(tmp); for(thisChannel in this.channels) { this.rmchan(Channels[this.channels[thisChannel]]); } if (whowas_pointer >= whowas_buffer) whowas_pointer = 0; if (!this.parent) ww_serverdesc = serverdesc; else ww_serverdesc = Clients[this.parent].realname; WhoWasHistory[whowas_pointer] = new WhoWas(this.nick,this.uprefix,this.hostname,this.realname,this.servername,ww_serverdesc); whowas_pointer++; if (do_bcast && (this.conntype > TYPE_UNREGISTERED) ) this.bcast_to_servers(tmp); } else if (this.server) { this.netsplit(servername + " " + this.nick); this.bcast_to_servers_raw("SQUIT " + this.nick + " :" + str); } if((server.client_remove!=undefined) && (this.conntype > TYPE_UNREGISTERED)) server.client_remove(this.socket); if (this.local) { this.rawout("ERROR :Closing Link: [" + this.uprefix + "@" + this.hostname + "] (" + str + ")"); oper_notice("Notice","Client exiting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + str + "] [" + this.ip + "]"); this.socket.close(); } this.conntype=TYPE_EMPTY; delete this.nick; delete this.socket; delete Clients[this.id]; delete this;} |
|
var chan; var cmodes; | function IRCClient_reintroduce_nick(nick) { var chan; var cmodes; this.server_nick_info(nick); for (uchan in nick.channels) { cmodes = ""; chan = nick.channels[uchan]; if (chan.modelist[CHANMODE_OP][nick.id]) cmodes += "@"; if (chan.modelist[CHANMODE_VOICE][nick.id]) cmodes += "+"; this.rawout("SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + cmodes + nick.nick); if (chan.topic) this.rawout("TOPIC " + chan.nam + " " + chan.topicchangedby + " " + chan.topictime + " :" + chan.topic); }} |
|
cmodes = ""; chan = nick.channels[uchan]; if (chan.modelist[CHANMODE_OP][nick.id]) cmodes += "@"; if (chan.modelist[CHANMODE_VOICE][nick.id]) cmodes += "+"; this.rawout("SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + cmodes + nick.nick); | var chan = nick.channels[uchan]; if (this.type == DREAMFORGE) { this.rawout(":" + nick.nick + " JOIN " + chan.nam); if (chan.modelist[CHANMODE_OP][nick.id]) this.ircout("MODE " + chan.nam + " +o " + nick.nick + " " + chan.created); if (chan.modelist[CHANMODE_VOICE][nick.id]) this.ircout("MODE " + chan.nam + " +v " + nick.nick + " " + chan.created); } else { var cmodes = ""; if (chan.modelist[CHANMODE_OP][nick.id]) cmodes += "@"; if (chan.modelist[CHANMODE_VOICE][nick.id]) cmodes += "+"; this.rawout("SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + cmodes + nick.nick); } | function IRCClient_reintroduce_nick(nick) { var chan; var cmodes; this.server_nick_info(nick); for (uchan in nick.channels) { cmodes = ""; chan = nick.channels[uchan]; if (chan.modelist[CHANMODE_OP][nick.id]) cmodes += "@"; if (chan.modelist[CHANMODE_VOICE][nick.id]) cmodes += "+"; this.rawout("SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + cmodes + nick.nick); if (chan.topic) this.rawout("TOPIC " + chan.nam + " " + chan.topicchangedby + " " + chan.topictime + " :" + chan.topic); }} |
if (chan.ismode(nick.id,CHANLIST_OP)) | if (chan.ismode(nick.id,CHANMODE_OP)) | function IRCClient_reintroduce_nick(nick) { var chan; var cmodes; if (!this.server || !nick) return 0; this.server_nick_info(nick); if (nick.away) this.rawout(":" + nick.nick + " AWAY :" + nick.away); for (uchan in nick.channels) { cmodes = ""; if (nick.channels[uchan]) { chan = Channels[nick.channels[uchan]]; if (chan.ismode(nick.id,CHANLIST_OP)) cmodes += "@"; if (chan.ismode(nick.id,CHANLIST_VOICE)) cmodes += "+"; this.rawout("SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + cmodes + nick.nick); if (chan.topic) this.rawout("TOPIC " + chan.nam + " " + chan.topicchangedby + " " + chan.topictime + " :" + chan.topic); } }} |
if (chan.ismode(nick.id,CHANLIST_VOICE)) | if (chan.ismode(nick.id,CHANMODE_VOICE)) | function IRCClient_reintroduce_nick(nick) { var chan; var cmodes; if (!this.server || !nick) return 0; this.server_nick_info(nick); if (nick.away) this.rawout(":" + nick.nick + " AWAY :" + nick.away); for (uchan in nick.channels) { cmodes = ""; if (nick.channels[uchan]) { chan = Channels[nick.channels[uchan]]; if (chan.ismode(nick.id,CHANLIST_OP)) cmodes += "@"; if (chan.ismode(nick.id,CHANLIST_VOICE)) cmodes += "+"; this.rawout("SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + cmodes + nick.nick); if (chan.topic) this.rawout("TOPIC " + chan.nam + " " + chan.topicchangedby + " " + chan.topictime + " :" + chan.topic); } }} |
rmchan_obj.del_modelist(this.id,CHANLIST_OP); rmchan_obj.del_modelist(this.id,CHANLIST_VOICE); | rmchan_obj.del_modelist(this.id,CHANMODE_OP); rmchan_obj.del_modelist(this.id,CHANMODE_VOICE); | function IRCClient_RMChan(rmchan_obj) { if (!rmchan_obj) return 0; for (k in rmchan_obj.users) { if (rmchan_obj.users[k] == this.id) delete rmchan_obj.users[k] } for(j in this.channels) { if (this.channels[j] == rmchan_obj.nam.toUpperCase()) delete this.channels[j]; } rmchan_obj.del_modelist(this.id,CHANLIST_OP); rmchan_obj.del_modelist(this.id,CHANLIST_VOICE); if (!rmchan_obj.count_users()) { delete rmchan_obj.users; delete rmchan_obj.mode; delete Channels[rmchan_obj.nam.toUpperCase()]; }} |
delete rmchan_obj.nam; | function IRCClient_RMChan(rmchan_obj) { if (!rmchan_obj) return 0; for (k in rmchan_obj.users) { if (rmchan_obj.users[k] == this.id) delete rmchan_obj.users[k] } for(j in this.channels) { if (this.channels[j] == rmchan_obj.nam.toUpperCase()) delete this.channels[j]; } rmchan_obj.del_modelist(this.id,CHANLIST_OP); rmchan_obj.del_modelist(this.id,CHANLIST_VOICE); if (!rmchan_obj.count_users()) { delete rmchan_obj.users; delete rmchan_obj.mode; delete Channels[rmchan_obj.nam.toUpperCase()]; delete rmchan_obj.nam; }} |
|
((ILines[thisILine].password == "") || (this.password == ILines[thisILine].password)) && | function IRCClient_searchbyiline() { for(thisILine in ILines) { // FIXME: We don't compare connecting port for now. if ( (match_irc_mask(this.uprefix + "@" + this.socket.remote_ip_address,ILines[thisILine].ipmask)) && ((ILines[thisILine].password == "") || (this.password == ILines[thisILine].password)) && (match_irc_mask(this.uprefix + "@" + this.hostname, ILines[thisILine].hostmask)) ) return ILines[thisILine].ircclass; } return 0;} |
|
return ILines[thisILine].ircclass; | return ILines[thisILine]; | function IRCClient_searchbyiline() { for(thisILine in ILines) { // FIXME: We don't compare connecting port for now. if ( (match_irc_mask(this.uprefix + "@" + this.socket.remote_ip_address,ILines[thisILine].ipmask)) && ((ILines[thisILine].password == "") || (this.password == ILines[thisILine].password)) && (match_irc_mask(this.uprefix + "@" + this.hostname, ILines[thisILine].hostmask)) ) return ILines[thisILine].ircclass; } return 0;} |
this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) | if (this.type == DREAMFORGE) { var df_chan_occs = sni_chan.occupants().split(' '); for (dfocc in df_chan_occs) { this.rawout(":" + df_chan_occs[dfocc] + " JOIN " + sni_chan.nam); } this.ircout("MODE " + sni_chan.nam + " " + sni_chan.chanmode(true) + " " + sni_chan.created); } else { this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) } | function IRCClient_server_chan_info(sni_chan) { this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) var modecounter=0; var modestr="+"; var modeargs=""; for (aBan in sni_chan.modelist[CHANMODE_BAN]) { modecounter++; modestr += "b"; if (modeargs) modeargs += " "; modeargs += sni_chan.modelist[CHANMODE_BAN][aBan]; if (modecounter >= max_modes) { this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); modecounter=0; modestr="+"; modeargs=""; } } if (modeargs) this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs);} |
this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); | var outstr = "MODE " + sni_chan.nam + " " + modestr + " " + modeargs; if (this.type == DREAMFORGE) outstr += " " + sni_chan.created; this.ircout(outstr); | function IRCClient_server_chan_info(sni_chan) { this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) var modecounter=0; var modestr="+"; var modeargs=""; for (aBan in sni_chan.modelist[CHANMODE_BAN]) { modecounter++; modestr += "b"; if (modeargs) modeargs += " "; modeargs += sni_chan.modelist[CHANMODE_BAN][aBan]; if (modecounter >= max_modes) { this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); modecounter=0; modestr="+"; modeargs=""; } } if (modeargs) this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs);} |
if (modeargs) this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); | if (modeargs) { var outstr = "MODE " + sni_chan.nam + " " + modestr + " " + modeargs; if (this.type == DREAMFORGE) outstr += " " + sni_chan.created; this.ircout(outstr); } | function IRCClient_server_chan_info(sni_chan) { this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) var modecounter=0; var modestr="+"; var modeargs=""; for (aBan in sni_chan.modelist[CHANMODE_BAN]) { modecounter++; modestr += "b"; if (modeargs) modeargs += " "; modeargs += sni_chan.modelist[CHANMODE_BAN][aBan]; if (modecounter >= max_modes) { this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); modecounter=0; modestr="+"; modeargs=""; } } if (modeargs) this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs);} |
for (aBan in sni_chan.modelist[CHANLIST_BAN]) { | for (aBan in sni_chan.modelist[CHANMODE_BAN]) { | function IRCClient_server_chan_info(sni_chan) { this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) var modecounter=0; var modestr="+"; var modeargs=""; for (aBan in sni_chan.modelist[CHANLIST_BAN]) { modecounter++; modestr += "b"; if (modeargs) modeargs += " "; modeargs += sni_chan.modelist[CHANLIST_BAN][aBan]; if (modecounter >= max_modes) { this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); modecounter=0; modestr="+"; modeargs=""; } } if (modeargs) this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs);} |
modeargs += sni_chan.modelist[CHANLIST_BAN][aBan]; | modeargs += sni_chan.modelist[CHANMODE_BAN][aBan]; | function IRCClient_server_chan_info(sni_chan) { this.rawout("SJOIN " + sni_chan.created + " " + sni_chan.nam + " " + sni_chan.chanmode(true) + " :" + sni_chan.occupants()) var modecounter=0; var modestr="+"; var modeargs=""; for (aBan in sni_chan.modelist[CHANLIST_BAN]) { modecounter++; modestr += "b"; if (modeargs) modeargs += " "; modeargs += sni_chan.modelist[CHANLIST_BAN][aBan]; if (modecounter >= max_modes) { this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs); modecounter=0; modestr="+"; modeargs=""; } } if (modeargs) this.ircout("MODE " + sni_chan.nam + " " + modestr + " " + modeargs);} |
break; case "INVITE": if (!cmd[2]) break; chanid = searchbychannel(cmd[2]); if (!chanid) break; if (!chanid.ismode(this.id,CHANLIST_OP)) break; nickid = searchbynick(cmd[1]); if (!nickid) break; if (nickid.onchannel(chanid.nam.toUpperCase())) break; nickid.originatorout("INVITE " + nickid.nick + " :" + chanid.nam,this); nickid.invited=chanid.nam.toUpperCase(); | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); if (command.match(/^[0-9]+/)) { // passing on a numeric to the client if (!cmd[1]) return 0; // uh...? var destination = searchbynick(cmd[1]); if (!destination) return 0; destination.rawout(":" + ThisOrigin.nick + " " + cmdline); return 1; } switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers_raw(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": oper_notice("Notice", "ERROR :from " + ThisOrigin.nick + "[(+)0@" + this.hostname + "] -- " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) nickid = searchbynick(search_nickbuf(cmd[2])); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (!target) target = searchbynick(search_nickbuf(kills[kill])); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.created) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.created) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); push_nickbuf(ThisOrigin.nick,cmd[1]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = 0; NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[3]; chan.topicchangedby = cmd[2]; str = "TOPIC " + chan.nam + " :" + chan.topic; ThisOrigin.bcast_to_channel(chan.nam,str,false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " TOPIC " + chan.nam + " " + ThisOrigin.nick + " " + chan.topictime + " :" + chan.topic); break; case "VERSION": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); if (match_irc_mask(servername, cmd[1])) { // it's for us, return the message ThisOrigin.numeric351(); } else { // psst, pass it on var dest_server = searchbyserver(cmd[1]); if (!dest_server) break; // someone messed up. dest_server.rawout(":" + ThisOrigin.nick + " VERSION :" + dest_server.nick); } break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
|
server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); | oper_notice("Notice", "ERROR :from " + ThisOrigin.nick + "[(+)0@" + this.hostname + "] -- " + ircstring(cmdline)); | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); if (command.match(/^[0-9]+/)) { // passing on a numeric to the client if (!cmd[1]) return 0; // uh...? var destination = searchbynick(cmd[1]); if (!destination) return 0; destination.rawout(":" + ThisOrigin.nick + " " + cmdline); return 1; } switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers_raw(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) nickid = searchbynick(search_nickbuf(cmd[2])); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (!target) target = searchbynick(search_nickbuf(kills[kill])); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.created) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.created) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); push_nickbuf(ThisOrigin.nick,cmd[1]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = 0; NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[3]; chan.topicchangedby = cmd[2]; str = "TOPIC " + chan.nam + " :" + chan.topic; ThisOrigin.bcast_to_channel(chan.nam,str,false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " TOPIC " + chan.nam + " " + ThisOrigin.nick + " " + chan.topictime + " :" + chan.topic); break; case "VERSION": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); if (match_irc_mask(servername, cmd[1])) { // it's for us, return the message ThisOrigin.numeric351(); } else { // psst, pass it on var dest_server = searchbyserver(cmd[1]); if (!dest_server) break; // someone messed up. dest_server.rawout(":" + ThisOrigin.nick + " VERSION :" + dest_server.nick); } break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
target.quit(reason,false); | this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (target) { target.quit(reason,false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.connecttime) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.connecttime) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. collide.quit("Nickname Collision"); this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = time(); // BROKEN XXX FIXME NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[2]; chan.topicchangedby = cmd[1]; str = "TOPIC " + chan.nam + " :" + chan.topic; this.bcast_to_channel(chan.nam,str,false); break; default: break; }} |
this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (target) { target.quit(reason,false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.connecttime) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.connecttime) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. collide.quit("Nickname Collision"); this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = time(); // BROKEN XXX FIXME NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[2]; chan.topicchangedby = cmd[1]; str = "TOPIC " + chan.nam + " :" + chan.topic; this.bcast_to_channel(chan.nam,str,false); break; default: break; }} |
|
case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (target) { target.quit(reason,false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.connecttime) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.connecttime) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. collide.quit("Nickname Collision"); this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = time(); // BROKEN XXX FIXME NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[2]; chan.topicchangedby = cmd[1]; str = "TOPIC " + chan.nam + " :" + chan.topic; this.bcast_to_channel(chan.nam,str,false); break; default: break; }} |
|
mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); if (command.match(/^[0-9]+/)) { // passing on a numeric to the client if (!cmd[1]) return 0; // uh...? var destination = searchbynick(cmd[1]); if (!destination) return 0; destination.rawout(":" + ThisOrigin.nick + " " + cmdline); return 1; } switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers_raw(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": oper_notice("Notice", "ERROR :from " + ThisOrigin.nick + "[(+)0@" + this.hostname + "] -- " + ircstring(cmdline)); ThisOrigin.quit(); break; case "INVITE": if (!cmd[2]) break; chanid = searchbychannel(cmd[2]); if (!chanid) break; if (!chanid.ismode(this.id,CHANLIST_OP)) break; nickid = searchbynick(cmd[1]); if (!nickid) break; if (nickid.onchannel(chanid.nam.toUpperCase())) break; nickid.originatorout("INVITE " + nickid.nick + " :" + chanid.nam,this); nickid.invited=chanid.nam.toUpperCase(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) nickid = searchbynick(search_nickbuf(cmd[2])); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (!target) target = searchbynick(search_nickbuf(kills[kill])); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.created) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.created) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); push_nickbuf(ThisOrigin.nick,cmd[1]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = 0; NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[3]; chan.topicchangedby = cmd[2]; str = "TOPIC " + chan.nam + " :" + chan.topic; ThisOrigin.bcast_to_channel(chan.nam,str,false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " TOPIC " + chan.nam + " " + ThisOrigin.nick + " " + chan.topictime + " :" + chan.topic); break; case "VERSION": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); if (match_irc_mask(servername, cmd[1])) { // it's for us, return the message ThisOrigin.numeric351(); } else { // psst, pass it on var dest_server = searchbyserver(cmd[1]); if (!dest_server) break; // someone messed up. dest_server.rawout(":" + ThisOrigin.nick + " VERSION :" + dest_server.nick); } break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
|
this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); | this.set_chanmode(chan, cmd[3] + " " + mode_args, bounce_modes); | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); if (command.match(/^[0-9]+/)) { // passing on a numeric to the client if (!cmd[1]) return 0; // uh...? var destination = searchbynick(cmd[1]); if (!destination) return 0; destination.rawout(":" + ThisOrigin.nick + " " + cmdline); return 1; } switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers_raw(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": oper_notice("Notice", "ERROR :from " + ThisOrigin.nick + "[(+)0@" + this.hostname + "] -- " + ircstring(cmdline)); ThisOrigin.quit(); break; case "INVITE": if (!cmd[2]) break; chanid = searchbychannel(cmd[2]); if (!chanid) break; if (!chanid.ismode(this.id,CHANLIST_OP)) break; nickid = searchbynick(cmd[1]); if (!nickid) break; if (nickid.onchannel(chanid.nam.toUpperCase())) break; nickid.originatorout("INVITE " + nickid.nick + " :" + chanid.nam,this); nickid.invited=chanid.nam.toUpperCase(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) nickid = searchbynick(search_nickbuf(cmd[2])); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (!target) target = searchbynick(search_nickbuf(kills[kill])); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.created) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.created) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); push_nickbuf(ThisOrigin.nick,cmd[1]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = 0; NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[3]; chan.topicchangedby = cmd[2]; str = "TOPIC " + chan.nam + " :" + chan.topic; ThisOrigin.bcast_to_channel(chan.nam,str,false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " TOPIC " + chan.nam + " " + ThisOrigin.nick + " " + chan.topictime + " :" + chan.topic); break; case "VERSION": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); if (match_irc_mask(servername, cmd[1])) { // it's for us, return the message ThisOrigin.numeric351(); } else { // psst, pass it on var dest_server = searchbyserver(cmd[1]); if (!dest_server) break; // someone messed up. dest_server.rawout(":" + ThisOrigin.nick + " VERSION :" + dest_server.nick); } break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); | this.set_chanmode(chan, cmd[3], bounce_modes); } | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); if (command.match(/^[0-9]+/)) { // passing on a numeric to the client if (!cmd[1]) return 0; // uh...? var destination = searchbynick(cmd[1]); if (!destination) return 0; destination.rawout(":" + ThisOrigin.nick + " " + cmdline); return 1; } switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers_raw(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": oper_notice("Notice", "ERROR :from " + ThisOrigin.nick + "[(+)0@" + this.hostname + "] -- " + ircstring(cmdline)); ThisOrigin.quit(); break; case "INVITE": if (!cmd[2]) break; chanid = searchbychannel(cmd[2]); if (!chanid) break; if (!chanid.ismode(this.id,CHANLIST_OP)) break; nickid = searchbynick(cmd[1]); if (!nickid) break; if (nickid.onchannel(chanid.nam.toUpperCase())) break; nickid.originatorout("INVITE " + nickid.nick + " :" + chanid.nam,this); nickid.invited=chanid.nam.toUpperCase(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) nickid = searchbynick(search_nickbuf(cmd[2])); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (!target) target = searchbynick(search_nickbuf(kills[kill])); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.created) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.created) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); push_nickbuf(ThisOrigin.nick,cmd[1]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = 0; NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[3]; chan.topicchangedby = cmd[2]; str = "TOPIC " + chan.nam + " :" + chan.topic; ThisOrigin.bcast_to_channel(chan.nam,str,false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " TOPIC " + chan.nam + " " + ThisOrigin.nick + " " + chan.topictime + " :" + chan.topic); break; case "VERSION": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); if (match_irc_mask(servername, cmd[1])) { // it's for us, return the message ThisOrigin.numeric351(); } else { // psst, pass it on var dest_server = searchbyserver(cmd[1]); if (!dest_server) break; // someone messed up. dest_server.rawout(":" + ThisOrigin.nick + " VERSION :" + dest_server.nick); } break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
ThisOrigin.set_chanmode(cmdline); | chan = searchbychannel(cmd[1]) if (!chan) break; var modeline = cmdline.slice(cmdline.indexOf(" ")+1); var modeline = modeline.slice(modeline.indexOf(" ")+1); ThisOrigin.set_chanmode(chan,modeline,false); | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); if (command.match(/^[0-9]+/)) { // passing on a numeric to the client if (!cmd[1]) return 0; // uh...? var destination = searchbynick(cmd[1]); if (!destination) return 0; destination.rawout(":" + ThisOrigin.nick + " " + cmdline); return 1; } switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers_raw(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": oper_notice("Notice", "ERROR :from " + ThisOrigin.nick + "[(+)0@" + this.hostname + "] -- " + ircstring(cmdline)); ThisOrigin.quit(); break; case "INVITE": if (!cmd[2]) break; chanid = searchbychannel(cmd[2]); if (!chanid) break; if (!chanid.ismode(this.id,CHANLIST_OP)) break; nickid = searchbynick(cmd[1]); if (!nickid) break; if (nickid.onchannel(chanid.nam.toUpperCase())) break; nickid.originatorout("INVITE " + nickid.nick + " :" + chanid.nam,this); nickid.invited=chanid.nam.toUpperCase(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) nickid = searchbynick(search_nickbuf(cmd[2])); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (!target) target = searchbynick(search_nickbuf(kills[kill])); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.created) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.created) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); push_nickbuf(ThisOrigin.nick,cmd[1]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = 0; NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; this.parent = this.id; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[3]; chan.topicchangedby = cmd[2]; str = "TOPIC " + chan.nam + " :" + chan.topic; ThisOrigin.bcast_to_channel(chan.nam,str,false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " TOPIC " + chan.nam + " " + ThisOrigin.nick + " " + chan.topictime + " :" + chan.topic); break; case "VERSION": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); if (match_irc_mask(servername, cmd[1])) { // it's for us, return the message ThisOrigin.numeric351(); } else { // psst, pass it on var dest_server = searchbyserver(cmd[1]); if (!dest_server) break; // someone messed up. dest_server.rawout(":" + ThisOrigin.nick + " VERSION :" + dest_server.nick); } break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
if ((collide) && (parseInt(collide.connecttime) < | if ((collide) && (parseInt(collide.created) < | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.connecttime) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.connecttime) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = time(); // BROKEN XXX FIXME NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[2]; chan.topicchangedby = cmd[1]; str = "TOPIC " + chan.nam + " :" + chan.topic; this.bcast_to_channel(chan.nam,str,false); break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
} else if ((collide) && (parseInt(collide.connecttime) > | } else if ((collide) && (parseInt(collide.created) > | function IRCClient_server_commands(origin, command, cmdline) { ThisOrigin = searchbynick(origin); if (!ThisOrigin) ThisOrigin = searchbyserver(origin); if (!ThisOrigin) ThisOrigin = this; cmd=cmdline.split(' '); switch(command) { case "GNOTICE": case "GLOBOPS": case "WALLOPS": if (!cmd[1]) break; str = ":" + origin + " WALLOPS :" + ircstring(cmdline); wallopers(str); this.bcast_to_servers(str); break; case "AWAY": if (!cmd[1]) ThisOrigin.away = ""; else ThisOrigin.away = ircstring(cmdline); break; case "ERROR": server_wallops("ERROR from " + ThisOrigin.nick + ": " + ircstring(cmdline)); ThisOrigin.quit(); break; case "KICK": if (!cmd[2]) break; chanid = searchbychannel(cmd[1]); if (!chanid) break; nickid = searchbynick(cmd[2]); if (!nickid) break; if (!nickid.onchannel(chanid.nam.toUpperCase())) break; if (cmd[3]) kick_reason = ircstring(cmdline).slice(0,max_kicklen); else kick_reason = ThisOrigin.nick; str = "KICK " + chanid.nam + " " + nickid.nick + " :" + kick_reason; ThisOrigin.bcast_to_channel(chanid.nam, str, false); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + str); nickid.rmchan(Channels[chanid.nam.toUpperCase()]); break; case "JOIN": if (!cmd[1]) break; if (cmd[1][0] == ":") cmd[1]=cmd[1].slice(1); the_channels = cmd[1].split(","); for (jchan in the_channels) { if (the_channels[jchan][0] != "#") break; ThisOrigin.do_join(the_channels[jchan].slice(0,max_chanlen),""); } break; case "SJOIN": if (!cmd[2]) break; if (cmd[2][0] != "#") break; chan = searchbychannel(cmd[2]); if (!chan) { cn_tuc = cmd[2].toUpperCase(); Channels[cn_tuc]=new Channel(cn_tuc); chan = Channels[cn_tuc]; chan.nam = cmd[2]; chan.created = cmd[1]; chan.topic = ""; chan.users = new Array(); chan.modelist[CHANLIST_BAN] = new Array(); chan.modelist[CHANLIST_VOICE] = new Array(); chan.modelist[CHANLIST_OP] = new Array(); chan.mode = CHANMODE_NONE; } if (cmd[3]) { if (chan.created == cmd[1]) bounce_modes = false; else bounce_modes = true; mode_args=""; tmp_modeargs=0; for (tmpmc in cmd[3]) { if (cmd[3][tmpmc] == "k") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } else if (cmd[3][tmpmc] == "l") { tmp_modeargs++; mode_args += cmd[3 + tmp_modeargs]; } } if (chan.created >= cmd[1]) { if (mode_args) this.set_chanmode("MODE " + chan.nam + " " + cmd[3] + " " + mode_args, bounce_modes); else this.set_chanmode("MODE " + chan.nam + " " + cmd[3], bounce_modes); } if ((cmd[4] == "") && cmd[5]) tmp_modeargs++; chan_members = ircstring(cmdline,4+tmp_modeargs).split(' '); for (member in chan_members) { is_op = false; is_voice = false; if (chan_members[member][0] == "@") { is_op = true; chan_members[member] = chan_members[member].slice(1); } if (chan_members[member][0] == "+") { is_voice = true; chan_members[member] = chan_members[member].slice(1); } member_obj = searchbynick(chan_members[member]); if (!member_obj) break; member_obj.channels.push(chan.nam.toUpperCase()); chan.users.push(member_obj.id); member_obj.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); if (chan.created >= cmd[1]) { if (is_op) { chan.modelist[CHANLIST_OP].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +o " + member_obj.nick); } if (is_voice) { chan.modelist[CHANLIST_VOICE].push(member_obj.id); this.bcast_to_channel(chan.nam, "MODE " + chan.nam + " +v " + member_obj.nick); } } } } else { ThisOrigin.channels.push(chan.nam.toUpperCase()); chan.users.push(ThisOrigin.id); ThisOrigin.bcast_to_channel(chan.nam, "JOIN " + chan.nam, false); } this.bcast_to_servers_raw(":" + servername + " SJOIN " + chan.created + " " + chan.nam + " " + chan.chanmode(true) + " :" + ircstring(cmdline)) break; case "SQUIT": if (!cmd[2]) break; sq_server = searchbyserver(cmd[1]); if (!sq_server) break; sq_server.quit(ThisOrigin.nick + " " + sq_server.nick); break; case "KILL": if (!cmd[2]) break; if (cmd[1].match(/[.]+/)) break; if (cmd[2] == ":") break; reason = ircstring(cmdline); kills = cmd[1].split(","); for(kill in kills) { target = searchbynick(kills[kill]); if (target) { this.bcast_to_servers_raw(":" + ThisOrigin.nick + " KILL " + target.nick + " :" + reason); target.quit("KILLED by " + ThisOrigin.nick + " (" + reason + ")",false); } } break; case "MODE": if (!cmd[1]) break; // nasty kludge since we don't support per-mode TS yet. if (cmd[2].match(/^[0-9]+$/) && (cmd[1][0] == "#") ) { cmdline="MODE " + cmd[1]; for(xx=3;xx<cmd.length;xx++) { cmdline += " "; cmdline += cmd[xx]; } } if (cmd[1][0] == "#") ThisOrigin.set_chanmode(cmdline); break; case "NICK": if (!cmd[8] && (cmd[2][0] != ":")) break; collide = searchbynick(cmd[1]); if ((collide) && (parseInt(collide.connecttime) < parseInt(cmd[3]) ) ) { // FIXME: At the moment, we rely on the remote // end to do the right thing. break; } else if ((collide) && (parseInt(collide.connecttime) > parseInt(cmd[3]) ) ) { // Nuke our side of things, allow this newly // introduced nick to overrule. this.bcast_to_servers("KILL " + collide.nick + " :Nickname Collision."); collide.quit("Nickname Collision"); } if (cmd[2][0] == ":") { cmd[2] = cmd[2].slice(1); ThisOrigin.created = cmd[2]; ThisOrigin.bcast_to_uchans_unique("NICK " + cmd[1]); this.bcast_to_servers_raw(":" + origin + " NICK " + cmd[1] + " :" + cmd[2]); ThisOrigin.nick = cmd[1]; } else if (cmd[10]) { new_id = get_next_clientid(); Clients[new_id]=new IRCClient(-1,new_id,false,true); NewNick = Clients[new_id]; NewNick.nick = cmd[1]; NewNick.hops = cmd[2]; NewNick.created = cmd[3]; NewNick.uprefix = cmd[5]; NewNick.hostname = cmd[6]; NewNick.servername = cmd[7]; NewNick.realname = ircstring(cmdline,10); NewNick.conntype = TYPE_USER_REMOTE; NewNick.away = ""; NewNick.mode = USERMODE_NONE; NewNick.connecttime = time(); // BROKEN XXX FIXME NewNick.idletime = 0; NewNick.talkidle = 0; NewNick.parent = this.id; NewNick.decip = cmd[9]; NewNick.setusermode(cmd[4]); true_hops = parseInt(NewNick.hops)+1; this.bcast_to_servers_raw("NICK " + NewNick.nick + " " + true_hops + " " + NewNick.created + " " + NewNick.get_usermode() + " " + NewNick.uprefix + " " + NewNick.hostname + " " + NewNick.servername + " 0 " + NewNick.decip + " :" + NewNick.realname); } break; case "NOTICE": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; notice_targets = cmd[1].split(','); for (notice in notice_targets) { if (notice_targets[notice][0] != "&") ThisOrigin.do_msg(notice_targets[notice],"NOTICE",ircstring(cmdline)); } break; case "PART": if (!cmd[1]) break; the_channels = cmd[1].split(","); for(pchan in the_channels) { ThisOrigin.do_part(the_channels[pchan]); } break; case "PRIVMSG": if (!cmd[1]) break; if ( !cmd[2] || ( !cmd[3] && ( (cmd[2] == ":") && (ircstring(cmdline) == "") ) ) ) break; privmsg_targets = cmd[1].split(','); for (privmsg in privmsg_targets) { if (privmsg_targets[privmsg][0] != "&") ThisOrigin.do_msg(privmsg_targets[privmsg],"PRIVMSG",ircstring(cmdline)); } break; case "PING": if (!cmd[1]) { break; } else { if (cmd[1][0] == ":") cmd[1] = cmd[1].slice(1); this.ircout("PONG " + servername + " :" + cmd[1]); } break; case "PONG": this.pinged = false; break; case "QUIT": ThisOrigin.quit(ircstring(cmdline),true); break; case "SERVER": if (!cmd[3]) break; if ((cmd[2] == 1) && !this.realname) { this.nick = cmd[1]; this.hops = 1; this.realname = ircstring(cmdline); this.linkparent = servername; newsrv = this; } else if (parseInt(cmd[2]) > 1) { new_id = get_next_clientid(); Clients[new_id] = new IRCClient(-1,new_id,false,false); newsrv = Clients[new_id]; newsrv.hops = cmd[2]; newsrv.nick = cmd[1]; newsrv.realname = ircstring(cmdline); newsrv.server = true; newsrv.parent = this.id; newsrv.conntype = TYPE_SERVER; newsrv.linkparent = ThisOrigin.nick; } else { break; } this.bcast_to_servers_raw(":" + newsrv.linkparent + " SERVER " + newsrv.nick + " " + (parseInt(newsrv.hops)+1) + " :" + newsrv.realname); break; case "TOPIC": if (!cmd[4]) break; chan = searchbychannel(cmd[1]); if (!chan) break; chan.topic = ircstring(cmdline); chan.topictime = cmd[2]; chan.topicchangedby = cmd[1]; str = "TOPIC " + chan.nam + " :" + chan.topic; this.bcast_to_channel(chan.nam,str,false); break; case "AKILL": if (!cmd[6]) break; this_uh = cmd[2] + "@" + cmd[1]; if (isklined(this_uh)) break; KLines.push(new KLine(this_uh,ircstring(cmdline),"A")); this.bcast_to_servers_raw(":" + ThisOrigin.nick + " " + cmdline); scan_for_klined_clients(); break; default: break; }} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.