Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Add support for error 477? #19

Closed
bmcallis opened this issue Jul 20, 2017 · 9 comments · Fixed by #23
Closed

Add support for error 477? #19

bmcallis opened this issue Jul 20, 2017 · 9 comments · Fixed by #23

Comments

@bmcallis
Copy link

When trying to join ##java on freenode, I'm getting a 477 command as the response. That command isn't in the switch statement in the raw listener, or in codes.js. So it's falling through to the default case and has a commandType of normal so it's only being log. Which means that I can't handle it to let the user know they can't join the channel.

Here is the log

20 Jul 16:15:32 - Unhandled message: { prefix: 'weber.freenode.net',
  server: 'weber.freenode.net',
  command: '477',
  rawCommand: '477',
  commandType: 'normal',
  args:
   [ 'nickname',
     '##java',
     'Cannot join channel (+r) - you need to be identified with services' ] }

Would it be possible to add that code so it gets emitted as an error? Or possibly emit unhandled messages so the client can handle them somehow?

@Throne3d
Copy link
Owner

You raise a good point! I didn't know there was a switch statement for the raw message – that seems weird and I'll look into it. This is an error that should probably be handled properly also. Thanks.

@Throne3d
Copy link
Owner

Oh. You mean the switch statement inside the raw handler doesn't include it? You should be able to handle this message specifically, for now, by adding a raw listener and checking by code.

An event for unhandled messages, separately, sounds like a good idea, as does handling this specific message. I'll get to that.

@bmcallis
Copy link
Author

I did add a raw listener so I can handle it in the meantime.

Yeah, that's the switch statement that I was referring to. Even if it was just added to codes.js with a type of error it'd fall through and get emitted as an error.

Thanks for forking this project and maintaining it.

Throne3d added a commit that referenced this issue Jul 21, 2017
Sadly, according to
http://defs.ircdocs.horse/defs/numerics.html#err-nochanmodes-477
it looks like error 477 has conflicting usage:

- ERR_NOCHANMODES (by RFC2812 spec)
- ERR_NEEDREGGEDNICK (with Bahamut, ircu, Unreal)

This commit allows codes to just specify a type, instead
of also a name, and adds a test to ensure this code is
parsed as expected.

It also fixes up the order of actual/expected in
test-parse-line.js's t.equal calls, and makes the messages
more grammatical in context (describe the test, not the
success).
@Throne3d
Copy link
Owner

No problem!

So it looks like error 477 has conflicting usage. http://defs.ircdocs.horse/defs/numerics.html#err-nochanmodes-477 puts it as both ERR_NOCHANMODES in the RFC2812 IRC spec and ERR_NEEDREGGEDNICK with some particular servers (Bahamut, ircu, Unreal). I've decided not to give it a name in the codes.js file, at least for now, but I've marked it as an error so you should be able to catch it in the regular error event.

Throne3d added a commit that referenced this issue Jul 21, 2017
Fix issue #19 by adding support for error 477
@Throne3d
Copy link
Owner

Throne3d commented Jul 21, 2017

PR #24 adds a new event, unhandled, which you should be able to catch and receive unhandled messages through. (See ce184fd and sorta d295563.)

@bmcallis
Copy link
Author

Thanks for updating this, I've been pointing to the latest commit and it's been working well. Do you think you'll be able to release a new version with it soon?

@Throne3d
Copy link
Owner

Throne3d commented Jul 25, 2017

I was planning on trying to get some other changes in before I do that – mostly bumping up the test coverage – but I probably don't really need to. Hm. I should have a new version out in about a week? I'm not sure about earlier than that, though, I'm trying to avoid doing too many new releases in a short period and I expect I'll find more changes I want to get through after looking through the codebase some more.

@bmcallis
Copy link
Author

That makes sense and sounds good to me. Thanks

@Throne3d
Copy link
Owner

Throne3d commented Aug 6, 2017

A bit later than I expected, and with less in the way of tests than I'd hoped (#29 lists the ones I hope to add soon, but it's a long list and kinda tedious to get to), but I've now released v0.7.0! Hopefully it all works as expected and I didn't accidentally mess anything up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants