From 820cafab938795f22fc771fca2000fcc961616a6 Mon Sep 17 00:00:00 2001
From: cyan <>
Date: Tue, 7 Feb 2006 20:06:19 +0000
Subject: [PATCH] * Fix a bug in my last update that would cause SJOIN +k and
 +l to not work   as expected (leaving dangling +l modes without an integer) *
 Updated copyright

---
 exec/ircd.js              |  6 +++---
 exec/load/ircd_channel.js |  2 +-
 exec/load/ircd_server.js  | 21 ++++++++++-----------
 exec/load/ircd_unreg.js   |  2 +-
 exec/load/ircd_user.js    |  2 +-
 5 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/exec/ircd.js b/exec/ircd.js
index 931990c697..2630812712 100644
--- a/exec/ircd.js
+++ b/exec/ircd.js
@@ -15,7 +15,7 @@
 //
 // Synchronet IRC Daemon as per RFC 1459, link compatible with Bahamut 1.4
 //
-// Copyright 2003-2005 Randolph Erwin Sommerfeld <sysop@rrx.ca>
+// Copyright 2003-2006 Randolph Erwin Sommerfeld <sysop@rrx.ca>
 //
 
 load("sbbsdefs.js");
@@ -1537,8 +1537,8 @@ function IRCClient_do_info() {
 	this.numeric(371, ":Deuce (Stephen Hurd): Resident Perl guru and Saskatchewan zealot.");
 	this.numeric(371, ":   Originally converted the IRCd to be object-oriented, various small");
 	this.numeric(371, ":   hacks, and lots of guidance.");
-	this.numeric(371, ":Greets to: Arrak, DWC, Foobar, Grey Fox/Zero/Unpaid, Grimp, Kufat,");
-	this.numeric(371, ":   Palom, Psyko, Torke, and all the #square oldbies.");
+	this.numeric(371, ":Greets to: Arrak, Elayne, Elvish Merchant, Foobar, Grimp, Kufat,");
+	this.numeric(371, ":   Nex, Palom, Psyko, Shaun, Torke, and all the #square oldbies.");
 	this.numeric(371, ":--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--");
 	this.numeric(371, ":Synchronet " + system.full_version);
 	this.numeric(371, ":Compiled with " + system.compiled_with + " at " + system.compiled_when);
diff --git a/exec/load/ircd_channel.js b/exec/load/ircd_channel.js
index 4053009731..e91fbf9af5 100644
--- a/exec/load/ircd_channel.js
+++ b/exec/load/ircd_channel.js
@@ -15,7 +15,7 @@
 //
 // Synchronet IRC Daemon as per RFC 1459, link compatible with Bahamut 1.4
 //
-// Copyright 2003-2005 Randolph Erwin Sommerfeld <sysop@rrx.ca>
+// Copyright 2003-2006 Randolph Erwin Sommerfeld <sysop@rrx.ca>
 //
 // ** Everything related to channels and their operation.
 //
diff --git a/exec/load/ircd_server.js b/exec/load/ircd_server.js
index f687c5963e..a9bd365a0b 100644
--- a/exec/load/ircd_server.js
+++ b/exec/load/ircd_server.js
@@ -15,7 +15,7 @@
 //
 // Synchronet IRC Daemon as per RFC 1459, link compatible with Bahamut 1.4
 //
-// Copyright 2003-2005 Randolph Erwin Sommerfeld <sysop@rrx.ca>
+// Copyright 2003-2006 Randolph Erwin Sommerfeld <sysop@rrx.ca>
 //
 // ** Server to server operation is governed here.
 //
@@ -695,11 +695,13 @@ function Server_Work() {
 
 			var chan_members;
 			var cm_array;
+			var mode_args;
 
 			if (cmd[3]) {
 				var incoming_modes = new Array;
-				var tmp_modeargs = 0;
+				var tmp_modeargs = 3;
 
+				/* Parse the modes and break them down */
 				for (tmpmc in cmd[3]) {
 					var my_modechar = cmd[3][tmpmc];
 					if (my_modechar == "+")
@@ -707,7 +709,7 @@ function Server_Work() {
 					if ((my_modechar == "k") ||
 					    (my_modechar == "l")) {
 						tmp_modeargs++;
-						incoming_modes[my_modechar] = cmd[3 + tmp_modeargs];
+						incoming_modes[my_modechar] = cmd[tmp_modeargs];
 					} else {
 						incoming_modes[my_modechar] = true;
 					}
@@ -722,13 +724,14 @@ function Server_Work() {
 						mode_args_args += " " + incoming_modes[my_mc];
 					}
 				}
-				var mode_args = mode_args_chars + mode_args_args;
+				mode_args = mode_args_chars + mode_args_args;
 
 				/* The following corrects a bug in Bahamut.. */
 				if ((cmd[4] == "") && cmd[5])
 					tmp_modeargs++;
 				
-				chan_members = IRC_string(cmdline,4+tmp_modeargs).split(' ');
+				tmp_modeargs++; /* Jump to start of string */
+				chan_members = IRC_string(cmdline,tmp_modeargs).split(' ');
 
 				if (chan_members == "") {
 					umode_notice(USERMODE_OPER,"Notice","Server " + this.nick + " trying to SJOIN empty channel " + cmd[2] + " before processing.");
@@ -781,12 +784,8 @@ function Server_Work() {
 				if (!ThisOrigin.local ||
 				    (chan.created == parseInt(cmd[1])))
 					bounce_modes = false;
-				if (chan.created >= parseInt(cmd[1])) {
-					if (mode_args)
-						this.set_chanmode(chan, cmd[3] + " " + mode_args, bounce_modes);
-					else
-						this.set_chanmode(chan, cmd[3], bounce_modes);
-				}
+				if (chan.created >= parseInt(cmd[1]))
+					this.set_chanmode(chan, mode_args, bounce_modes);
 
 				var num_sync_modes = 0;
 				var push_sync_modes = "+";
diff --git a/exec/load/ircd_unreg.js b/exec/load/ircd_unreg.js
index cc5527c372..0c2ea77249 100644
--- a/exec/load/ircd_unreg.js
+++ b/exec/load/ircd_unreg.js
@@ -15,7 +15,7 @@
 //
 // Synchronet IRC Daemon as per RFC 1459, link compatible with Bahamut 1.4
 //
-// Copyright 2003-2005 Randolph Erwin Sommerfeld <sysop@rrx.ca>
+// Copyright 2003-2006 Randolph Erwin Sommerfeld <sysop@rrx.ca>
 //
 // ** Handle unregistered clients.
 //
diff --git a/exec/load/ircd_user.js b/exec/load/ircd_user.js
index bc72164d8d..9c3fb983ef 100644
--- a/exec/load/ircd_user.js
+++ b/exec/load/ircd_user.js
@@ -15,7 +15,7 @@
 //
 // Synchronet IRC Daemon as per RFC 1459, link compatible with Bahamut 1.4
 //
-// Copyright 2003-2005 Randolph Erwin Sommerfeld <sysop@rrx.ca>
+// Copyright 2003-2006 Randolph Erwin Sommerfeld <sysop@rrx.ca>
 //
 // ** Handle registered clients.
 //
-- 
GitLab