Skip to content
Snippets Groups Projects
Commit 57363546 authored by Randy Sommerfeld's avatar Randy Sommerfeld
Browse files
parent bac614de
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -420,26 +420,47 @@ function Server_Work(cmdline) {
));
break;
case "MODE":
if (typeof p[1] === undefined)
if (typeof p[1] === undefined) {
umode_notice(USERMODE_OPER,"Notice",format(
"Origin %s sent MODE without enough arguments.",
this.nick
));
break;
if (p[0][0] != "#") { /* Setting a user mode */
tmp = origin.setusermode(p[1]);
if (tmp) {
this.bcast_to_servers_raw(format(
":%s MODE %s %s",
origin.nick,
origin.nick,
tmp
}
/* Detect TS-style MODE and stuff the real TS in j */
j = parseInt(p[0]);
if (p[0] == j) {
if (!this.hub)
j = Epoch();
p.shift();
}
if (p[0][0] == "#") {
/* Setting a channel mode */
tmp = Channels[p[0].toUpperCase()];
if (!tmp) {
umode_notice(USERMODE_OPER,"Notice",format(
"Origin %s sent MODE with invalid channel %s",
this.nick,
p[0]
));
break;
}
if (!j)
j = tmp.created;
p.shift();
origin.set_chanmode(tmp,p,j);
break;
}
/* Setting a channel mode */
tmp = Channels[p[0].toUpperCase()];
if (!tmp)
break;
p.shift();
origin.set_chanmode(tmp,p,parseInt(p[1]));
/* Setting a user mode */
tmp = origin.setusermode(p[1]);
if (tmp) {
this.bcast_to_servers_raw(format(
":%s MODE %s %s",
origin.nick,
origin.nick,
tmp
));
}
break;
case "MOTD":
if (!p[0] || origin.server)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment