Fugiman/jIRCs — pull request #3 by ElementalAlchemist (2012-07-04 04:10:01+00:00)
Title: Store usermodes and channel modes

This adds storing for user modes and channel modes.
User modes are just stored in an array, as they don't take parameters. (Some servers do server notices by giving a parameter to the server notice mode, though, which may be handled later.)

Channel modes are stored in an object, mode => parameter. Parameterless modes are stored with an empty string parameter in the same object so that they can be looked up just as easily from the same place.
It makes sure that (with the exception of list modes) the local mode list matches up with the mode list of the channel, including sending a MODE request on join and reading the 324, since the server doesn't send that by default, so we have from the beginning the modes active on the channel.

Let me know if you prefer a different style for switch statements and I'll acknowledge it in the future if I use more for some reason.