learned from node-xmpp