csegames/cu-ui — pull request #2 by jcdickinson (2014-07-15 23:42:44+00:00)
Title: Feature refactored xmpp

- Cleaning up multiple aspects of the client-side of XMPP.

**Notes:**

- Don't: rely on prefixes to determine namespace. Use the namespace. `stream:stream` is not part of RFC 3920, `{http://etherx.jabber.org/streams}stream` is.
- Don't: assume elements with no prefix to have the correct NS.
- I don't have a way to test this. YMMV.

This is just a start, it's late at the moment so I wanted to send this in to see if you liked and would like more like it. I'll happily carry on improving on this in my spare time. **Stuff that still needs work:**

- Much more functionality needs to be pulled out of `cu.ts` (basically all the On...Stanza funcs, Send... funcs, etc.), it's a god class.
- Stream features need a callback/trigger mechanism too.
- It wouldn't hurt to give SASL mechanisms the same treatment.
- Also, presence.

**Some concerns:**

- That login token. Oh my. A nonce + HMAC or something should be used, possibly have this buried in the compiled client - send through a placeholder value or have some specific API call.
- Overall: I would go look at the code for Adobe Brackets or similar. Message/command passing would be a winner here. The current system might run into issues as:
- As more features are added to the base UI maintaining it will likely be a nightmare.
- Hook-in points for mods. The current system isn't very extensible, message/command passing is. *Not saying message/command passing is a golden hammer but it's worth investigating.*
- I'll POC this for you this weekend but, again: YMMV.