Skip to content
Snippets Groups Projects
Commit e9cb2835 authored by Randy Sommerfeld's avatar Randy Sommerfeld
Browse files

First attempt at cleaning up mode processing

parent 0efb0e9f
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -44,7 +44,7 @@ const VERSION_STR = format( ...@@ -44,7 +44,7 @@ const VERSION_STR = format(
system.platform, system.beta_version system.platform, system.beta_version
); );
/* This will be replaced with a dynamic CAPAB system */ /* This will be replaced with a dynamic CAPAB system */
const SERVER_CAPAB = "TS3 NOQUIT SSJOIN BURST UNCONNECT NICKIP TSMODE"; const SERVER_CAPAB = "TS3 NOQUIT SSJOIN BURST UNCONNECT NICKIP NICKIPSTR TSMODE";
/* This will be in the configuration for 2.0 */ /* This will be in the configuration for 2.0 */
const SUMMON = true; const SUMMON = true;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Everything related to channels in the IRCd and their operation. Everything related to channels in the IRCd and their operation.
Copyright 2003-2022 Randy Sommerfeld <cyan@synchro.net> Copyright 2003-2023 Randy Sommerfeld <cyan@synchro.net>
*/ */
...@@ -48,8 +48,8 @@ MODE[CHANMODE_VOICE] = new IRC_Channel_Mode("v",true,false,true,true); ...@@ -48,8 +48,8 @@ MODE[CHANMODE_VOICE] = new IRC_Channel_Mode("v",true,false,true,true);
/* Object Prototypes */ /* Object Prototypes */
function Channel(nam) { function Channel(name) {
this.nam = nam; this.nam = name;
this.mode = CHANMODE_NONE; this.mode = CHANMODE_NONE;
this.topic = ""; this.topic = "";
this.topictime = 0; this.topictime = 0;
...@@ -71,6 +71,7 @@ function Channel(nam) { ...@@ -71,6 +71,7 @@ function Channel(nam) {
this.count_modelist = Channel_count_modelist; this.count_modelist = Channel_count_modelist;
this.occupants = Channel_Occupants; this.occupants = Channel_Occupants;
this.match_list_mask = Channel_match_list_mask; this.match_list_mask = Channel_match_list_mask;
this.is_str_member_of_chanmode_list = Channel_is_str_member_of_chanmode_list;
} }
function ChanMode_tweaktmpmode(tmp_bit,add) { function ChanMode_tweaktmpmode(tmp_bit,add) {
...@@ -102,17 +103,17 @@ function ChanMode_tweaktmpmodelist(bit,add,arg) { ...@@ -102,17 +103,17 @@ function ChanMode_tweaktmpmodelist(bit,add,arg) {
this.user.numeric482(this.chan.nam); this.user.numeric482(this.chan.nam);
return 0; return 0;
} }
for (i in this.tmplist[bit][add]) { for (i in this.list[bit][add]) {
/* Is this argument in our list for this mode already? */ /* Is this argument in our list for this mode already? */
if (this.tmplist[bit][add][i].toUpperCase() == arg.toUpperCase()) if (this.list[bit][add][i].toUpperCase() == arg.toUpperCase())
return 0; return 0;
} }
/* It doesn't exist on our mode, push it in. */ /* It doesn't exist on our mode, push it in. */
this.tmplist[bit][add].push(arg); this.list[bit][add].push(arg);
/* Check for it against the other mode, and maybe nuke it. */ /* Check for it against the other mode, and maybe nuke it. */
for (i in this.tmplist[bit][add ? false : true]) { for (i in this.list[bit][add ? false : true]) {
if (this.tmplist[bit][add ? false : true][i].toUpperCase() == arg.toUpperCase()) { if (this.list[bit][add ? false : true][i].toUpperCase() == arg.toUpperCase()) {
delete this.tmplist[bit][add ? false : true][i]; delete this.list[bit][add ? false : true][i];
return 0; return 0;
} }
} }
...@@ -120,11 +121,11 @@ function ChanMode_tweaktmpmodelist(bit,add,arg) { ...@@ -120,11 +121,11 @@ function ChanMode_tweaktmpmodelist(bit,add,arg) {
function ChanMode_affect_mode_list(list_bit) { function ChanMode_affect_mode_list(list_bit) {
var tmp_nick, add, z; var tmp_nick, add, z;
for (add in this.tmplist[list_bit]) { for (add in this.list[list_bit]) {
for (z in this.tmplist[list_bit][add]) { for (z in this.list[list_bit][add]) {
tmp_nick = Users[this.tmplist[list_bit][add][z].toUpperCase()]; tmp_nick = Users[this.list[list_bit][add][z].toUpperCase()];
if (!tmp_nick) if (!tmp_nick)
tmp_nick = search_nickbuf(this.tmplist[list_bit][add][z]); tmp_nick = search_nickbuf(this.list[list_bit][add][z]);
if (tmp_nick && (add=="true") && !this.chan.modelist[list_bit][tmp_nick.id]) { if (tmp_nick && (add=="true") && !this.chan.modelist[list_bit][tmp_nick.id]) {
this.addmodes += MODE[list_bit].modechar; this.addmodes += MODE[list_bit].modechar;
this.addmodeargs += " " + tmp_nick.nick; this.addmodeargs += " " + tmp_nick.nick;
...@@ -137,7 +138,7 @@ function ChanMode_affect_mode_list(list_bit) { ...@@ -137,7 +138,7 @@ function ChanMode_affect_mode_list(list_bit) {
this.delmodeargs += " " + tmp_nick.nick; this.delmodeargs += " " + tmp_nick.nick;
delete this.chan.modelist[list_bit][tmp_nick.id]; delete this.chan.modelist[list_bit][tmp_nick.id];
} else if (!tmp_nick && this.local) { } else if (!tmp_nick && this.local) {
this.user.numeric401(this.tmplist[list_bit][add][z]); this.user.numeric401(this.list[list_bit][add][z]);
} }
} }
} }
...@@ -217,17 +218,17 @@ function Channel_Occupants() { ...@@ -217,17 +218,17 @@ function Channel_Occupants() {
} }
function ChanMode(chan,user) { function ChanMode(chan,user) {
this.tmplist = new Object; this.list = {};
this.tmplist[CHANMODE_OP] = new Object; this.list[CHANMODE_OP] = {};
this.tmplist[CHANMODE_OP][false] = new Array; //deop this.list[CHANMODE_OP][false] = [];
this.tmplist[CHANMODE_OP][true] = new Array; //op this.list[CHANMODE_OP][true] = [];
this.tmplist[CHANMODE_VOICE] = new Object; this.list[CHANMODE_VOICE] = {};
this.tmplist[CHANMODE_VOICE][false] = new Array; //devoice this.list[CHANMODE_VOICE][false] = [];
this.tmplist[CHANMODE_VOICE][true] = new Array; //voice this.list[CHANMODE_VOICE][true] = [];
this.tmplist[CHANMODE_BAN] = new Object; this.list[CHANMODE_BAN] = {};
this.tmplist[CHANMODE_BAN][false] = new Array; //unban this.list[CHANMODE_BAN][false] = [];
this.tmplist[CHANMODE_BAN][true] = new Array; //ban this.list[CHANMODE_BAN][true] = [];
this.state_arg = new Object; this.state_arg = {};
this.state_arg[CHANMODE_KEY] = ""; this.state_arg[CHANMODE_KEY] = "";
this.state_arg[CHANMODE_LIMIT] = ""; this.state_arg[CHANMODE_LIMIT] = "";
this.addbits = 0; this.addbits = 0;
...@@ -244,9 +245,10 @@ function ChanMode(chan,user) { ...@@ -244,9 +245,10 @@ function ChanMode(chan,user) {
this.affect_mode_list = ChanMode_affect_mode_list; this.affect_mode_list = ChanMode_affect_mode_list;
} }
function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { function IRCClient_set_chanmode(chan,cm_args,ts) {
var c, i, j; var c, i, j;
var add; var add;
var final_modestr = "";
if (!chan || !cm_args) { if (!chan || !cm_args) {
throw "set_chanmode() called without chan or cm_args"; throw "set_chanmode() called without chan or cm_args";
...@@ -347,36 +349,55 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -347,36 +349,55 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
break; break;
} }
// If we're bouncing modes, traverse our side of what the modes look /* If we have TS supremacy (that is, if this server has a channel
// like and remove any modes not mentioned by what was passed to the TS less than the incoming channel TS), then we invert the modes
// function. Or, clear any ops, voiced members, or bans on the 'bad' sent to us if they're not part of the channel object already. */
// side of the network sync. if (ts > chan.created) {
if (bounce_modes) {
for (i in MODE) { for (i in MODE) {
if (MODE[i].state && (chan.mode&i) && !(c.addbits&i)) {
c.delbits |= i; if (MODE[i].state && (chan.mode&i) && (c.addbits&i)) {
} else if (MODE[i].state && !(chan.mode&i) && (c.addbits&i)) { continue;
c.addbits&=~i;
} else if (MODE[i].list && MODE[i].isnick) {
for (j in chan.modelist[i]) {
c.delmodes += MODE[i].modechar;
c.delmodeargs += " " + chan.modelist[i][j].nick;
delete chan.modelist[i][j];
} }
} else if (MODE[i].list && !MODE[i].isnick) {
for (j in chan.modelist[i]) { if (MODE[i].state && !(chan.mode&i) && (c.addbits&i)) {
c.delmodes += MODE[i].modechar; this.ircout(format("MODE %lu %s %s",
c.delmodeargs += " " + chan.modelist[i][j]; chan.created,
delete chan.modelist[i][j]; chan.nam,
delete chan.bantime[j]; "-" + MODE[i].modechar
delete chan.bancreator[j]; ));
continue;
} }
if (MODE[i].list) {
for (j in c.list[i][true]) {
if (chan.is_str_member_of_chanmode_list(i,c.list[i][true][j])) {
continue;
}
this.ircout(format("MODE %lu %s %s",
chan.created,
chan.nam,
"-" + MODE[i].modechar + " " + c.list[i][true][j]
));
}
for (j in c.list[i][false]) {
if (chan.is_str_member_of_chanmode_list(i,c.list[i][false][j])) {
this.ircout(format("MODE %lu %s %s",
chan.created,
chan.nam,
"+" + MODE[i].modechar + " " + c.list[i][false][j]
));
} }
} }
} }
// Now we run through all the mode toggles and construct our lists for }
// later display. We also play with the channel bit switches here.
/* We end processing here if we're inverting modes from a TS violation */
return;
}
/* Now we run through all the mode toggles and construct our lists for
later display. We also play with the channel bit switches here. */
for (i in MODE) { for (i in MODE) {
if (MODE[i].state) { if (MODE[i].state) {
if ( (i&CHANMODE_KEY) if ( (i&CHANMODE_KEY)
...@@ -385,7 +406,6 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -385,7 +406,6 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
&& chan.arg[i] && chan.arg[i]
&& !this.server && !this.server
&& !this.parent && !this.parent
&& !bounce_modes
) { ) {
this.numeric(467, format("%s :Channel key already set.", chan.nam)); this.numeric(467, format("%s :Channel key already set.", chan.nam));
} else if ( (c.addbits&i) } else if ( (c.addbits&i)
...@@ -416,8 +436,8 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -416,8 +436,8 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
} }
} }
// This is a special case, if +b was passed to us without arguments, /* This is a special case, if +b was passed to us without arguments,
// we simply display a list of bans on the channel. we simply display a list of bans on the channel. */
if (c.addbits&CHANMODE_BAN) { if (c.addbits&CHANMODE_BAN) {
for (i in chan.modelist[CHANMODE_BAN]) { for (i in chan.modelist[CHANMODE_BAN]) {
this.numeric(367, format( this.numeric(367, format(
...@@ -432,9 +452,9 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -432,9 +452,9 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
} }
/* Bans are a specialized case */ /* Bans are a specialized case */
for (i in c.tmplist[CHANMODE_BAN][true]) { // +b for (i in c.list[CHANMODE_BAN][true]) { // +b
var set_ban = create_ban_mask( var set_ban = create_ban_mask(
c.tmplist[CHANMODE_BAN][add][i]); c.list[CHANMODE_BAN][add][i]);
if ( (chan.count_modelist(CHANMODE_BAN) >= MAX_BANS) if ( (chan.count_modelist(CHANMODE_BAN) >= MAX_BANS)
&& !this.server && !this.server
&& !this.parent && !this.parent
...@@ -452,14 +472,14 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -452,14 +472,14 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
} }
} }
for (i in c.tmplist[CHANMODE_BAN][false]) { // -b for (i in c.list[CHANMODE_BAN][false]) { // -b
for (j in chan.modelist[CHANMODE_BAN]) { for (j in chan.modelist[CHANMODE_BAN]) {
if ( c.tmplist[CHANMODE_BAN][false][i].toUpperCase() if ( c.list[CHANMODE_BAN][false][i].toUpperCase()
== chan.modelist[CHANMODE_BAN][j].toUpperCase() == chan.modelist[CHANMODE_BAN][j].toUpperCase()
) { ) {
c.delmodes += "b"; c.delmodes += "b";
c.delmodeargs += " " + c.delmodeargs += " " +
c.tmplist[CHANMODE_BAN][false][i]; c.list[CHANMODE_BAN][false][i];
delete chan.modelist[CHANMODE_BAN][j]; delete chan.modelist[CHANMODE_BAN][j];
delete chan.bantime[j]; delete chan.bantime[j];
delete chan.bancreator[j]; delete chan.bancreator[j];
...@@ -474,8 +494,6 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -474,8 +494,6 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
if (!c.addmodes && !c.delmodes) if (!c.addmodes && !c.delmodes)
return 0; return 0;
var final_modestr = "";
if (c.addmodes) if (c.addmodes)
final_modestr += "+" + c.addmodes; final_modestr += "+" + c.addmodes;
if (c.delmodes) if (c.delmodes)
...@@ -519,7 +537,7 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -519,7 +537,7 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
break; break;
} }
if (mode_counter >= MAX_MODES) { if (mode_counter >= MAX_MODES) {
var str = "MODE " + chan.nam + " " + mode_output + f_mode_args; var str = format("MODE %s %s%s", chan.nam, mode_output, f_mode_args);
if (!this.server) if (!this.server)
this.bcast_to_channel(chan, str, true); this.bcast_to_channel(chan, str, true);
else else
...@@ -536,7 +554,7 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -536,7 +554,7 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
} }
if (mode_output.length > 1) { if (mode_output.length > 1) {
str = "MODE " + chan.nam + " " + mode_output + f_mode_args; var str = format("MODE %s %s%s", chan.nam, mode_output, f_mode_args);
if (!this.server) if (!this.server)
this.bcast_to_channel(chan, str, true); this.bcast_to_channel(chan, str, true);
else else
...@@ -548,6 +566,29 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) { ...@@ -548,6 +566,29 @@ function IRCClient_set_chanmode(chan,cm_args,bounce_modes) {
return 1; return 1;
} }
function Channel_is_str_member_of_chanmode_list(modebit,str) {
var i;
if (!modebit || !MODE[modebit] || !MODE[modebit].list)
throw "Channel_is_str_member_of_chanmode_list() called with invalid channel modebit";
str = str.toUpperCase();
if (MODE[modebit].isnick) {
for (i in this.modelist[modebit]) {
if (this.modelist[modebit].nick.toUpperCase() == str)
return true;
}
} else {
for (i in this.modelist[modebit]) {
if (this.modelist[modebit].toUpperCase() == str)
return true;
}
}
return false;
}
function IRCClient_do_join(chan_name,join_key) { function IRCClient_do_join(chan_name,join_key) {
chan_name = chan_name.slice(0,MAX_CHANLEN) chan_name = chan_name.slice(0,MAX_CHANLEN)
...@@ -615,7 +656,7 @@ function IRCClient_do_join(chan_name,join_key) { ...@@ -615,7 +656,7 @@ function IRCClient_do_join(chan_name,join_key) {
} }
if (chan_name[0] != "&") { if (chan_name[0] != "&") {
this.bcast_to_servers_raw( this.bcast_to_servers_raw(
format(":%s SJOIN %s %s", format(":%s SJOIN %lu %s",
this.nick, this.nick,
chan.created, chan.created,
chan.nam chan.nam
...@@ -636,7 +677,7 @@ function IRCClient_do_join(chan_name,join_key) { ...@@ -636,7 +677,7 @@ function IRCClient_do_join(chan_name,join_key) {
} }
if (chan_name[0] != "&") { if (chan_name[0] != "&") {
this.bcast_to_servers_raw( this.bcast_to_servers_raw(
format(":%s SJOIN %s %s %s :%s%s", format(":%s SJOIN %lu %s %s :%s%s",
ServerName, ServerName,
chan.created, chan.created,
chan.nam, chan.nam,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Anything that handles manipulating the IRCd configuration. Anything that handles manipulating the IRCd configuration.
Copyright 2003-2022 Randy Sommerfeld <cyan@synchro.net> Copyright 2003-2023 Randy Sommerfeld <cyan@synchro.net>
*/ */
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Core IRCd functions. Core IRCd functions.
Copyright 2003-2022 Randy Sommerfeld <cyan@synchro.net> Copyright 2003-2023 Randy Sommerfeld <cyan@synchro.net>
*/ */
...@@ -207,7 +207,7 @@ function Scan_For_Banned_Clients() { ...@@ -207,7 +207,7 @@ function Scan_For_Banned_Clients() {
if ( isklined(user.uprefix + "@" + user.hostname) if ( isklined(user.uprefix + "@" + user.hostname)
|| IP_Banned(user.ip) || IP_Banned(user.ip)
) { ) {
this.quit("User has been banned"); user.quit("User has been banned");
} }
} }
} }
...@@ -1371,7 +1371,7 @@ function IRCClient_do_info() { ...@@ -1371,7 +1371,7 @@ function IRCClient_do_info() {
this.servername this.servername
)); ));
this.numeric(371, ":--=-=-=-=-=-=-=-=-=-=-*[ The Synchronet IRCd 1.9 ]*-=-=-=-=-=-=-=-=-=-=--"); this.numeric(371, ":--=-=-=-=-=-=-=-=-=-=-*[ The Synchronet IRCd 1.9 ]*-=-=-=-=-=-=-=-=-=-=--");
this.numeric(371, ": IRCd Copyright 2003-2022 by Randy Sommerfeld <cyan@synchro.net>"); this.numeric(371, ": IRCd Copyright 2003-2023 by Randy Sommerfeld <cyan@synchro.net>");
this.numeric(371, ":" + system.version_notice + " " + system.copyright + "."); this.numeric(371, ":" + system.version_notice + " " + system.copyright + ".");
this.numeric(371, ":--=-=-=-=-=-=-=-=-=-( A big thanks to the following )-=-=-=-=-=-=-=-=-=--"); this.numeric(371, ":--=-=-=-=-=-=-=-=-=-( A big thanks to the following )-=-=-=-=-=-=-=-=-=--");
this.numeric(371, ":DigitalMan (Rob Swindell): Resident coder god, various hacking all"); this.numeric(371, ":DigitalMan (Rob Swindell): Resident coder god, various hacking all");
...@@ -1382,7 +1382,7 @@ function IRCClient_do_info() { ...@@ -1382,7 +1382,7 @@ function IRCClient_do_info() {
this.numeric(371, ": hacks, and lots of guidance."); this.numeric(371, ": hacks, and lots of guidance.");
this.numeric(371, ":Thanks to the DALnet Bahamut team for their help over the years."); this.numeric(371, ":Thanks to the DALnet Bahamut team for their help over the years.");
this.numeric(371, ":Greets to: Arrak, ElvishMerchant, Foobar, Grimp, Kufat, Psyko,"); this.numeric(371, ":Greets to: Arrak, ElvishMerchant, Foobar, Grimp, Kufat, Psyko,");
this.numeric(371, ": Samael, TheStoryTillNow, Torke, and all the #square oldbies."); this.numeric(371, ": Samael, TheStoryTillNow, Torke, #sqt, and all the #square oldbies.");
this.numeric(371, ":In memory of Palidor (Alex Kimbel) March 17, 1984 - December 12, 2012."); this.numeric(371, ":In memory of Palidor (Alex Kimbel) March 17, 1984 - December 12, 2012.");
this.numeric(371, ":--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--"); this.numeric(371, ":--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--");
this.numeric(371, ":Synchronet " + system.full_version); this.numeric(371, ":Synchronet " + system.full_version);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
IRCd inter-server communication. IRCd inter-server communication.
Copyright 2003-2022 Randy Sommerfeld <cyan@synchro.net> Copyright 2003-2023 Randy Sommerfeld <cyan@synchro.net>
*/ */
...@@ -438,13 +438,8 @@ function Server_Work(cmdline) { ...@@ -438,13 +438,8 @@ function Server_Work(cmdline) {
tmp = Channels[p[0].toUpperCase()]; tmp = Channels[p[0].toUpperCase()];
if (!tmp) if (!tmp)
break; break;
j = false; /* bounce our side? */
if (parseInt(p[1]) > tmp.created) /* TS violation TODO: bounce their side */
break;
if (parseInt(p[1]) < tmp.created && origin.server)
j = true;
p.shift(); p.shift();
origin.set_chanmode(tmp,p,j); origin.set_chanmode(tmp,p,parseInt(p[1]));
break; break;
case "MOTD": case "MOTD":
if (!p[0] || origin.server) if (!p[0] || origin.server)
...@@ -574,7 +569,7 @@ function Server_Work(cmdline) { ...@@ -574,7 +569,7 @@ function Server_Work(cmdline) {
j.servername = p[6]; j.servername = p[6];
j.realname = p[9]; j.realname = p[9];
j.parent = this.nick; j.parent = this.nick;
j.ip = int_to_ip(p[8]); j.ip = p[8];
j.setusermode(p[3]); j.setusermode(p[3]);
for (i in ULines) { for (i in ULines) {
if (ULines[i] == p[6]) { if (ULines[i] == p[6]) {
...@@ -583,7 +578,7 @@ function Server_Work(cmdline) { ...@@ -583,7 +578,7 @@ function Server_Work(cmdline) {
} }
} }
this.bcast_to_servers_raw( this.bcast_to_servers_raw(
format("NICK %s %d %lu %s %s %s %s 0 %lu :%s", format("NICK %s %d %lu %s %s %s %s 0 %s :%s",
j.nick, j.nick,
j.hops + 1, j.hops + 1,
j.created, j.created,
...@@ -591,7 +586,7 @@ function Server_Work(cmdline) { ...@@ -591,7 +586,7 @@ function Server_Work(cmdline) {
j.uprefix, j.uprefix,
j.hostname, j.hostname,
j.servername, j.servername,
ip_to_int(j.ip), j.ip,
j.realname j.realname
) )
); );
...@@ -910,7 +905,7 @@ function Server_Work(cmdline) { ...@@ -910,7 +905,7 @@ function Server_Work(cmdline) {
this.set_chanmode( this.set_chanmode(
tmp, /* channel */ tmp, /* channel */
p.splice(2,p.length-3), /* modeline and arguments */ p.splice(2,p.length-3), /* modeline and arguments */
(tmp.created >= parseInt(p[0])) ? false : true /* ts superiority */ parseInt(p[0]) /* ts */
); );
j = p[p.length-1].split(" "); /* Channel members */ j = p[p.length-1].split(" "); /* Channel members */
...@@ -1431,7 +1426,7 @@ function IRCClient_server_info(sni_server) { ...@@ -1431,7 +1426,7 @@ function IRCClient_server_info(sni_server) {
function IRCClient_server_nick_info(sni_client) { function IRCClient_server_nick_info(sni_client) {
this.rawout( this.rawout(
format("NICK %s %d %lu %s %s %s %s 0 %lu :%s", format("NICK %s %d %lu %s %s %s %s 0 %s :%s",
sni_client.nick, sni_client.nick,
parseInt(sni_client.hops) + 1, parseInt(sni_client.hops) + 1,
sni_client.created, sni_client.created,
...@@ -1439,7 +1434,7 @@ function IRCClient_server_nick_info(sni_client) { ...@@ -1439,7 +1434,7 @@ function IRCClient_server_nick_info(sni_client) {
sni_client.uprefix, sni_client.uprefix,
sni_client.hostname, sni_client.hostname,
sni_client.servername, sni_client.servername,
ip_to_int(sni_client.ip), sni_client.ip,
sni_client.realname sni_client.realname
) )
); );
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
How unregistered clients are handled in the IRCd. How unregistered clients are handled in the IRCd.
Copyright 2003-2022 Randy Sommerfeld <cyan@synchro.net> Copyright 2003-2023 Randy Sommerfeld <cyan@synchro.net>
*/ */
...@@ -426,13 +426,13 @@ function Unregistered_Welcome() { ...@@ -426,13 +426,13 @@ function Unregistered_Welcome() {
)); ));
if (server.client_update != undefined) if (server.client_update != undefined)
server.client_update(this.socket, this.nick, this.hostname); server.client_update(this.socket, this.nick, this.hostname);
server_bcast_to_servers(format("NICK %s 1 %lu + %s %s %s 0 %lu :%s", server_bcast_to_servers(format("NICK %s 1 %lu + %s %s %s 0 %s :%s",
this.nick, this.nick,
new_user.created, new_user.created,
this.uprefix, this.uprefix,
this.hostname, this.hostname,
ServerName, ServerName,
ip_to_int(new_user.ip), new_user.ip,
this.realname this.realname
)); ));
log(LOG_NOTICE, format( log(LOG_NOTICE, format(
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Handling of regular user-to-server communication in the IRCd. Handling of regular user-to-server communication in the IRCd.
Copyright 2003-2022 Randy Sommerfeld <cyan@synchro.net> Copyright 2003-2023 Randy Sommerfeld <cyan@synchro.net>
*/ */
...@@ -343,7 +343,7 @@ function User_Work(cmdline) { ...@@ -343,7 +343,7 @@ function User_Work(cmdline) {
break; break;
} }
p.shift(); p.shift();
this.set_chanmode(tmp, p, false /* bounce? */); this.set_chanmode(tmp, p, tmp.created);
} else if (p[0].toUpperCase() == this.nick.toUpperCase()) { } else if (p[0].toUpperCase() == this.nick.toUpperCase()) {
this.setusermode(p[1]); this.setusermode(p[1]);
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment