Skip to content

Commit

Permalink
Stylistic changes, history update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Young committed Jul 4, 2012
1 parent b318d45 commit b404e1b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
7 changes: 7 additions & 0 deletions 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)
Expand Down
1 change: 0 additions & 1 deletion README.textile
Expand Up @@ -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/.

23 changes: 11 additions & 12 deletions lib/server.js
Expand Up @@ -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;
})
},

Expand Down Expand Up @@ -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;
});
}
},
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit b404e1b

Please sign in to comment.