Skip to content

Commit

Permalink
Merge pull request #276 from Trinitas/patch-1
Browse files Browse the repository at this point in the history
WEBIRC support
  • Loading branch information
Chris Nehren committed Jan 9, 2015
2 parents b6e9772 + a83064c commit 63ae435
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function Client(server, nick, opt) {
autoRejoin: true,
autoConnect: true,
channels: [],
webirc: {},
retryCount: null,
retryDelay: 2000,
secure: false,
Expand Down Expand Up @@ -678,7 +679,10 @@ Client.prototype.connect = function(retryCount, callback) {
self.conn.authorizationError === 'CERT_HAS_EXPIRED') {
util.log('Connecting to server with expired certificate');
}
if (self.opt.password !== null) {
if (typeof self.opt.webirc.ip) {
self.send('WEBIRC', self.opt.webirc.pass, self.opt.userName, self.opt.webirc.host, self.opt.webirc.ip);
}
if (self.opt.password) {
self.send('PASS', self.opt.password);
}
if (self.opt.debug)
Expand Down Expand Up @@ -706,7 +710,10 @@ Client.prototype.connect = function(retryCount, callback) {
if (self.opt.sasl) {
// see http://ircv3.atheme.org/extensions/sasl-3.1
self.send('CAP REQ', 'sasl');
} else if (self.opt.password !== null) {
}
if (typeof self.opt.webirc.ip) {
self.send('WEBIRC', self.opt.webirc.pass, self.opt.userName, self.opt.webirc.host, self.opt.webirc.ip);
}else if (self.opt.password) {
self.send('PASS', self.opt.password);
}
self.send('NICK', self.opt.nick);
Expand Down

0 comments on commit 63ae435

Please sign in to comment.