Commit 3c7454c4 authored by JC Brand's avatar JC Brand

Document a better way to open a room from a plugin

parent f9343594
......@@ -911,18 +911,20 @@ It takes 3 parameters:
.. code-block:: javascript
converse.plugins.add('myplugin', {
initialize: function () {
var nick = 'dread-pirate-roberts';
var create_if_not_found = true;
this._converse.api.rooms.open(
'group@muc.example.com',
{'nick': nick},
create_if_not_found
)
var _converse = this._converse;
_converse.api.waitUntil('roomsAutoJoined').then(function () {
var create_if_not_found = true;
this._converse.api.rooms.open(
'group@muc.example.com',
{'nick': 'dread-pirate-roberts'},
create_if_not_found
)
});
}
});
open
~~~~
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment