Document a better way to open a room from a plugin
This commit is contained in:
parent
f9343594bf
commit
3c7454c4c1
|
@ -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
|
||||
~~~~
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user