This page covers using XMPP-FTW from the browser. You may also
want to check out the demo and
the chat client.
These colour conventions are also carried over into the demo client.
JIDs are always sent as an object as follows:
{ "user": "lloyd", "domain": "evilprofessor.co.uk", "resource": "laptop" }
Errors are delivered in the following form:
{ type: "auth", /* condition: "forbidden", */ /* description: "Only owners can configure rooms" */ /* application: { condition: 'too-many-users', /* xmlns: 'my:custom:ns', */ /* description: 'We\'re still in beta' */ } */ }
Client errors follow a similar format to standard XMPP error responses. An example error looks like this:
{ type: "modify", condition: "client-error", description: "Missing JID parameter", request: { message: "Hello you!" } }
If the request included a callback this will be sent back as the first argument (i.e. 'error' variable), otherwise the message will come back as a xmpp.error.client event.
Note: use of 'bad-request' was avoided to ensure that a client → XMPP-FTW was discernible from a pure client → XMPP error.
If your XMPP server closes the connection then you will be informed via xmpp.error as follows:
{ type: "connection", condition: "disconnected", description: "XMPP client disconnected" }