Browse files

Stylistic changes, history update

  • Loading branch information...
1 parent b318d45 commit b404e1be1da8e7cd71084a463937f549f9b2aaa7 Alex Young committed Jul 4, 2012
Showing with 18 additions and 13 deletions.
  1. +7 −0 History.md
  2. +0 −1 README.textile
  3. +11 −12 lib/server.js
View
7 History.md
@@ -1,3 +1,10 @@
+0.0.15 / 2012-07-04
+
+ * Default channels (Sebastian A. Espindola)
+ * Migrated tests to Mocha
+ * Tested against Node 0.8
+ * Locked down module versions
+
0.0.14 / 2012-06-05
* Added connection passwords (PASS)
View
1 README.textile
@@ -83,4 +83,3 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see "http://www.gnu.org/licenses/":http://www.gnu.org/licenses/.
-
View
23 lib/server.js
@@ -141,10 +141,10 @@ Server.prototype = {
},
valueExists: function(value, collection, field) {
- var context = this;
- value = context.normalizeName(value);
+ var self = this;
+ value = this.normalizeName(value);
return collection.some(function(u) {
- return context.normalizeName(u[field]) === value;
+ return self.normalizeName(u[field]) === value;
})
},
@@ -203,11 +203,11 @@ Server.prototype = {
},
createDefaultChannels: function() {
- var context = this;
+ var self = this;
if (this.config.channels) {
Object.keys(this.config.channels).forEach(function(channel) {
- var newChan = context.channels.registered[context.normalizeName(channel)] = new Channel(channel, context);
- newChan.topic = context.config.channels[channel].topic;
+ var newChannel = self.channels.registered[self.normalizeName(channel)] = new Channel(channel, self);
+ newChannel.topic = self.config.channels[channel].topic;
});
}
},
@@ -238,19 +238,18 @@ Server.prototype = {
},
start: function(callback) {
- var server = this;
+ var server = this, key, cert, options;
if (this.config.key && this.config.cert) {
try {
- var key = fs.readFileSync(this.config.key);
- var cert = fs.readFileSync(this.config.cert);
+ key = fs.readFileSync(this.config.key);
+ cert = fs.readFileSync(this.config.cert);
} catch (exception) {
winston.error('Fatal error:', exception);
}
- var options = { key: key, cert: cert };
+ options = { key: key, cert: cert };
this.server = tls.createServer(options, handleStream);
- }
- else {
+ } else {
this.server = net.createServer(handleStream);
}

0 comments on commit b404e1b

Please sign in to comment.