From 57aae4ad2664003e4c237490ac074494d82d9bf2 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 15 Mar 2016 08:28:41 +0000 Subject: [PATCH] Mention `send` API command and fix formatting. --- docs/source/development.rst | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/source/development.rst b/docs/source/development.rst index 7c33368ac..d0bfc5d84 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -202,6 +202,23 @@ Example: roster_groups: true }); +send +---- + +Allows you to send XML stanzas. + +For example, to send a message stanza: + +.. code-block:: javascript + + var msg = converse.env.$msg({ + from: 'juliet@example.com/balcony', + to:'romeo@example.net', + type:'chat' + }); + converse.send(msg); + + The "archive" grouping ---------------------- @@ -229,7 +246,6 @@ It accepts the following optional parameters: Examples ^^^^^^^^ - **Requesting all archived messages** The simplest query that can be made is to simply not pass in any parameters. @@ -250,6 +266,7 @@ the returned messages. } converse.archive.query(callback, errback)) + **Waiting until server support has been determined** The query method will only work if converse.js has been able to determine that @@ -666,7 +683,7 @@ Returns a token, either the RID or SID token depending on what's asked for. Example: - .. code-block:: javascript +.. code-block:: javascript converse.tokens.get('rid') @@ -691,7 +708,7 @@ grouping: For example: - .. code-block:: javascript +.. code-block:: javascript converse.listen.on('message', function (event, messageXML) { ... }); @@ -707,7 +724,7 @@ grouping: For example: - .. code-block:: javascript +.. code-block:: javascript converse.listen.once('message', function (event, messageXML) { ... }); @@ -722,7 +739,7 @@ grouping: For example: - .. code-block:: javascript +.. code-block:: javascript converse.listen.not('message', function (event, messageXML) { ... });