Fugiman/jIRCs — pull request #1 by ElementalAlchemist (2012-07-02 02:52:12+00:00)
Title: Save the userlist for each channel

So I've gone ahead and made each entry of jIRCs.channels an object; in doing so, I also fixed a problem where you were pushing to an array only if that object was already in it. :P (If this was intentional for some reason, it's simple enough to change back in its new form.)

There doesn't seem to be a store of network information besides the class itself, so I just put server prefix information there. If it goes somewhere else, let me know. The only thing I'm saving currently is the prefixes currently used by the server, in the format { symbol => mode }, in case for whatever reason we need the mode char for something. (That could be a simple array of symbols if we don't.)

The multi-prefix ability I mentioned works by pulling all of the status symbols off the name. This is opposed to just 1 as stated in the IRC standards; more than one is sent only to clients that support it (either by the client acknowledging NAMESX in response to the 005 or through CAP multi-prefix). I don't know how much this would come up on Desert Bus's IRC, but it's still compatible with having only 1 (just the userlist is desynced if someone with more than one status loses their highest one, but that's more of an issue with IRC in general that multi-prefix is meant to fix). I also opted to append to the nicklist on 353, and start it over if we got a 366 since the last 353. I don't personally know of a better way to handle this. (Maybe I'm just entirely unconfident in my JS abilities.)