ojii/txircd — pull request #1 by ElementalAlchemist (2012-09-12 20:31:09+00:00)
Title: Connection Numeric Parameters

I'm planning on sending pull requests in smallish chunks where I can to keep things separate, so you can merge parts of it where you want to. Let me know if you have major issues with this (like if you want to pull everything for some reason, or... I don't know what else. Maybe that's it). Feel free to comment on any individual pull requests or any changes you find objectionable for some reason.

Anyway, this first submission tries to fix the connection numerics (currently just 001-004 but that seems to be all that's sent currently anyway) such that clients won't trip over them or panic or stuff. I noticed two things that were not liked that were unliked by clients:
- The lack of required parameters (you have to send the nick as a parameter before the rest of the parameters for nearly all of the numerics)
- The lack of mode specifications in 004

I've opted to fix these by simply adding the nickname parameter to the four and (for now) by hard-coding the RFC 1459 required user and channel modes into the 004 numeric. I figured it wouldn't be too much of a problem since empty strings were already hard-coded there anyway, and it can still be changed later.

As a note acknowledging the third commit: not all numerics return only string data. Many have more than one parameter, so a colon is typically not appropriate to start the token immediately after the numeric. I'm not sure if it was originally there due to an error or a true misunderstanding, though, since some other multi-parameter numerics seem to be correct (e.g. 353).