Permalink
Browse files

Configurable channel prefixes (closes #99)

  • Loading branch information...
1 parent 92feb5c commit c1b7028d66c6f00bed03e473a5486b348789be47 @martynsmith committed Oct 25, 2012
Showing with 5 additions and 3 deletions.
  1. +2 −1 docs/API.rst
  2. +3 −2 lib/irc.js
View
@@ -29,7 +29,8 @@ Client
certExpired: false,
floodProtection: false,
floodProtectionDelay: 1000,
- stripColors: false
+ stripColors: false,
+ channelPrefixes: "&#"
}
`secure` (SSL connection) can be a true value or an object (the kind of object
View
@@ -48,7 +48,8 @@ function Client(server, nick, opt) {
certExpired: false,
floodProtection: false,
floodProtectionDelay: 1000,
- stripColors: false
+ stripColors: false,
+ channelPrefixes: "&#"
};
if (typeof arguments[2] == 'object') {
@@ -386,7 +387,7 @@ function Client(server, nick, opt) {
break;
}
self.emit('message', from, to, text, message);
- if ( to.match(/^[&#]/) ) {
+ if ( self.opt.channelPrefixes.indexOf(to.charAt(0)) !== -1 ) {
self.emit('message#', from, to, text, message);
self.emit('message' + to, from, text, message);
if ( to != to.toLowerCase() ) {

0 comments on commit c1b7028

Please sign in to comment.