ircanywhere / irc-factory

A rebuilt irc-factory from simple-irc-socket and irc-message. Get support at #ircanywhere on freenode
https://ircanywhere.com
MIT License
60 stars 14 forks source link

'registered' event never being triggered #14

Closed silverbucket closed 9 years ago

silverbucket commented 10 years ago

Hey Ricki, at some point the register event seems to have stopped firing for me. I was wondering the best way to dig deaper into irc-factory to see what's going on here?

      function onRegister(object) {
        console.log('connected! ', object);
        irc.unhookEvent(key, 'registered');
        ...
      }

      irc.unhookEvent(key, '*');
      irc.hookEvent(key, 'registered', onRegister);

      // connect...
      client = irc.createClient(key, module_creds);

my key and module_creds:

key:  nkj-test@irc.freenode.net
module_creds:  { 
  nick: 'nkj-test',
  user: '',
  server: 'irc.freenode.net',
  realname: '',
  port: 6667,
  secure: false 
}

The onRegister is never getting called.

Any ideas?

rickihastings commented 10 years ago

Sorry for late response.

What network are you testing on, freenode yeah?

silverbucket commented 9 years ago

Yup, freenode. Sorry for the late reply, must have missed the notification.

silverbucket commented 9 years ago

Just an update, this turns out was an issue with using '' for the user and/or realname. The IRC server rejects the USER command as not having enough params. Defaulting to using the nick for both user and realname if there is no other data to use seems to fix the connection.