martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

SASL broken on Rizon #550

Closed Myaamori closed 5 years ago

Myaamori commented 5 years ago

irc.js contains the following code for identifying CAP messages:

            case 'CAP':
                if (message.args[0] === '*' &&
                     message.args[1] === 'ACK' &&
                     message.args[2] === 'sasl ') // there's a space after sasl
                    self.send('AUTHENTICATE', 'PLAIN');
                break;

However, in practice a CAP message from Rizon looks like:

{ prefix: 'irc.x2x.cc',
  server: 'irc.x2x.cc',
  command: 'CAP',
  rawCommand: 'CAP',
  commandType: 'normal',
  args: [ '*', 'ACK', 'sasl' ] }

I.e. with no space after "sasl", and thus no AUTHENTICATE message is sent, causing the bot to fail to connect.

Myaamori commented 5 years ago

This has already been fixed in this more actively maintained fork: https://github.com/Throne3d/node-irc