The "roomviews" namespace groups methods relevant to chatroom (aka groupchats) views.
- Source:
Methods
(static) close(jids) → {Promise}
Lets you close open chatrooms.
You can call this method without any arguments to close all open chatrooms, or you can specify a single JID or an array of JIDs.
Parameters:
Name | Type | Description |
---|---|---|
jids |
Array.<String> | String | The JID or array of JIDs of the chatroom(s) |
- Source:
Returns:
- Promise which resolves once the views have been closed.
- Type
- Promise
(static) get(name) → {View}
Retrieves a groupchat (aka chatroom) view. The chat should already be open.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Array.<string> | e.g. 'coven@conference.shakespeare.lit' or ['coven@conference.shakespeare.lit', 'cave@conference.shakespeare.lit'] |
- Source:
Returns:
View representing the groupchat
- Type
- View
Examples
// To return a single view, provide the JID of the groupchat
const view = _converse.api.roomviews.get('coven@conference.shakespeare.lit');
// To return an array of views, provide an array of JIDs:
const views = _converse.api.roomviews.get(['coven@conference.shakespeare.lit', 'cave@conference.shakespeare.lit']);
// To return views of all open groupchats, call the method without any parameters::
const views = _converse.api.roomviews.get();