Converse converse.js

Namespace: _converse

_converse

A private, closured object containing the private api (via _converse.api) as well as private methods and internal data-structures.

Source:

Namespaces

ChatBox
ChatBox
ChatBoxView
ChatRoom
ChatRoom
ChatRoomMessage
ChatRoomMessage
ChatRoomMessages
ChatRoomMessages
ChatRoomOccupant
ChatRoomOccupant
ChatRoomOccupants
ChatRoomOccupants
Device
DeviceList
DeviceLists
EmojiPicker
EmojiPicker
HeadlinesFeed
HeadlinesFeed
HeadlinesFeedsList
Message
Message
RegisterPanel
RosterView
VCard
VCard
api
api

Methods

(private, static) __(str)

Translate the given string based on the current locale.

Parameters:
Name Type Description
str String
Source:

(private, static) __(str)

Translate the given string based on the current locale.

Parameters:
Name Type Description
str String
Source:

(private, static) ___(str)

A no-op method which is used to signal to gettext that the passed in string should be included in the pot translation file.

In contrast to the double-underscore method, the triple underscore method doesn't actually translate the strings.

One reason for this method might be because we're using strings we cannot send to the translation function because they require variable interpolation and we don't yet have the variables at scan time.

Parameters:
Name Type Description
str String
Source:

(private, static) ___(str)

A no-op method which is used to signal to gettext that the passed in string should be included in the pot translation file.

In contrast to the double-underscore method, the triple underscore method doesn't actually translate the strings.

One reason for this method might be because we're using strings we cannot send to the translation function because they require variable interpolation and we don't yet have the variables at scan time.

Parameters:
Name Type Description
str String
Source:

(static) exports.isInfoVisible(code)

Determines info message visibility based on muc_show_info_messages configuration setting

Parameters:
Name Type Description
code *
Source:

(static) isInfoVisible(code)

Determines info message visibility based on muc_show_info_messages configuration setting

Parameters:
Name Type Description
code *
Source:

Events

MAMResult

Synchronous event which allows listeners to first do some work based on the MAM result before calling the handlers here.

Source:

MAMResult

Synchronous event which allows listeners to first do some work based on the MAM result before calling the handlers here.

Source:

OMEMOInitialized

Triggered once OMEMO support has been initialized

Source:
Example
_converse.api.listen.on('OMEMOInitialized', () => { ... });

VCardsInitialized

Triggered as soon as the _converse.vcards collection has been initialized and populated from cache.

Source:

VCardsInitialized

Triggered as soon as the _converse.vcards collection has been initialized and populated from cache.

Source:

addClientFeatures

Triggered in converse-disco once the core disco features of Converse have been added.

Source:
Example
_converse.api.listen.on('addClientFeatures', () => { ... });

addClientFeatures

Triggered in converse-disco once the core disco features of Converse have been added.

Source:
Example
_converse.api.listen.on('addClientFeatures', () => { ... });

afterFileUploaded

Hook which allows plugins to change the attributes saved on the message once a file has been uploaded.

Source:

afterFileUploaded

Hook which allows plugins to change the attributes saved on the message once a file has been uploaded.

Source:

afterMessageBodyTransformed

Synchronous event which provides a hook for transforming a chat message's body text after the default transformations have been applied.

Parameters:
Name Type Description
text RichText

A RichText instance. You can call RichText#addTemplateResult on it in order to add TemplateResult objects meant to render rich parts of the message.

Source:
Example
_converse.api.listen.on('afterMessageBodyTransformed', (view, text) => { ... });

afterMessagesFetched

Triggered whenever a { @link _converse.ChatBox } or ${ @link _converse.ChatRoom } has fetched its messages from the local cache.

Type:
Source:
Example
_converse.api.listen.on('afterMessagesFetched', (chat) => { ... });

afterMessagesFetched

Triggered whenever a { @link _converse.ChatBox } or ${ @link _converse.ChatRoom } has fetched its messages from the local cache.

Type:
Source:
Example
_converse.api.listen.on('afterMessagesFetched', (chat) => { ... });

afterResourceBinding

Synchronous event triggered after we've sent an IQ to bind the user's JID resource for this session.

Source:

afterResourceBinding

Synchronous event triggered after we've sent an IQ to bind the user's JID resource for this session.

Source:

beforeFetchLoginCredentials

Hook which allows modifying the server request

Source:

beforeFetchLoginCredentials

Hook which allows modifying the server request

Source:

beforeFileUpload

Hook which allows plugins to transform files before they'll be uploaded. The main use-case is to encrypt the files.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this file will be uploaded.

file File

The file that will be uploaded

Source:

beforeFileUpload

Hook which allows plugins to transform files before they'll be uploaded. The main use-case is to encrypt the files.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this file will be uploaded.

file File

The file that will be uploaded

Source:

beforeLogout

Triggered before the user is logged out

Source:

beforeLogout

Triggered before the user is logged out

Source:

beforeMessageBodyTransformed

Synchronous event which provides a hook for transforming a chat message's body text before the default transformations have been applied.

Parameters:
Name Type Description
text RichText

A RichText instance. You can call RichText#addTemplateResult on it in order to add TemplateResult objects meant to render rich parts of the message.

Source:
Example
_converse.api.listen.on('beforeMessageBodyTransformed', (view, text) => { ... });

beforeResourceBinding

Synchronous event triggered before we send an IQ to bind the user's JID resource for this session.

Source:

beforeResourceBinding

Synchronous event triggered before we send an IQ to bind the user's JID resource for this session.

Source:

bookmarksInitialized

Triggered once the _converse.Bookmarks collection has been created and cached bookmarks have been fetched.

Type:
  • _converse.Bookmarks
Source:
Example
_converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });

bookmarksInitialized

Triggered once the _converse.Bookmarks collection has been created and cached bookmarks have been fetched.

Type:
  • _converse.Bookmarks
Source:
Example
_converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });

cachedRoster

The contacts roster has been retrieved from the local cache (sessionStorage).

Type:
Source:
Examples
_converse.api.listen.on('cachedRoster', (items) => { ... });
_converse.api.waitUntil('cachedRoster').then(items => { ... });

cachedRoster

The contacts roster has been retrieved from the local cache (sessionStorage).

Type:
Source:
Examples
_converse.api.listen.on('cachedRoster', (items) => { ... });
_converse.api.waitUntil('cachedRoster').then(items => { ... });

callButtonClicked

When a call button (i.e. with class .toggle-call) on a chatbox has been clicked.

Type:
  • object
Properties:
Name Type Description
_converse.connection Strophe.Connection

The XMPP Connection object

_converse.connection _converse.ChatBox | _converse.ChatRoom

The XMPP Connection object

Source:
Example
_converse.api.listen.on('callButtonClicked', (connection, model) => { ... });

chatBoxBlurred

Triggered when the focus has been removed from a particular chat.

Type:
Source:
Example
_converse.api.listen.on('chatBoxBlurred', (view, event) => { ... });

chatBoxClosed

Triggered once a chatbox has been closed.

Type:
Source:
Example
_converse.api.listen.on('chatBoxClosed', chat => { ... });

chatBoxClosed

Triggered once a chatbox has been closed.

Type:
Source:
Example
_converse.api.listen.on('chatBoxClosed', chat => { ... });

chatBoxFocused

Triggered when the focus has been moved to a particular chat.

Type:
Source:
Example
_converse.api.listen.on('chatBoxFocused', (view, event) => { ... });

chatBoxInitialized

Triggered once a _converse.ChatBox has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatBoxInitialized', model => { ... });

chatBoxInitialized

Triggered once a _converse.ChatBox has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatBoxInitialized', model => { ... });

chatBoxMaximized

Triggered when a previously minimized chat gets maximized

Type:
Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

Triggered once the _converse.RosterContacts been created, but not yet populated with data. This event is useful when you want to create views for these collections.

Source:
Examples
_converse.api.listen.on('rosterInitialized', () => { ... });
_converse.api.waitUntil('rosterInitialized').then(() => { ... });

chatBoxMaximized

After the user has sent out a direct invitation (as per XEP-0249), to a roster contact, asking them to join a room.

Type:
  • object
Properties:
Name Type Description
room _converse.ChatRoom
recipient string

The JID of the person being invited

reason string

The original reason for the invitation

Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

After the user has sent out a direct invitation (as per XEP-0249), to a roster contact, asking them to join a room.

Type:
  • object
Properties:
Name Type Description
room _converse.ChatRoom
recipient string

The JID of the person being invited

reason string

The original reason for the invitation

Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

Triggered once the _converse.RosterContacts been created, but not yet populated with data. This event is useful when you want to create views for these collections.

Source:
Examples
_converse.api.listen.on('rosterInitialized', () => { ... });
_converse.api.waitUntil('rosterInitialized').then(() => { ... });

chatBoxMinimized

Triggered when a previously maximized chat gets Minimized

Type:
Source:
Example
_converse.api.listen.on('chatBoxMinimized', view => { ... });

chatBoxScrolledDown

Triggered once the converse-chat-content element has been scrolled down to the bottom.

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom

The chat model

Source:
Example
_converse.api.listen.on('chatBoxScrolledDown', obj => { ... });

chatBoxScrolledUp

Triggered once the chat's message area has been scrolled to the top

Properties:
Name Type Description
view _converse.ChatBoxView | _converse.ChatRoomView
Source:
Example
_converse.api.listen.on('chatBoxScrolledUp', obj => { ... });

chatBoxViewInitialized

Triggered once the _converse.ChatBoxView has been initialized

Type:
Source:
Example
_converse.api.listen.on('chatBoxViewInitialized', view => { ... });

chatBoxViewsInitialized

Triggered once the _converse.ChatBoxViews view-colleciton has been initialized

Source:
Example
_converse.api.listen.on('chatBoxViewsInitialized', () => { ... });

chatBoxesFetched

Triggered once all chat boxes have been recreated from the browser cache

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom
stanza Element
Source:
Examples
_converse.api.listen.on('chatBoxesFetched', obj => { ... });
_converse.api.waitUntil('chatBoxesFetched').then(() => { ... });

chatBoxesFetched

Triggered once all chat boxes have been recreated from the browser cache

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom
stanza Element
Source:
Examples
_converse.api.listen.on('chatBoxesFetched', obj => { ... });
_converse.api.waitUntil('chatBoxesFetched').then(() => { ... });

chatBoxesInitialized

Triggered once the _converse.ChatBoxes collection has been initialized.

Source:
Examples
_converse.api.listen.on('chatBoxesInitialized', () => { ... });
_converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });

chatBoxesInitialized

Triggered once the _converse.ChatBoxes collection has been initialized.

Source:
Examples
_converse.api.listen.on('chatBoxesInitialized', () => { ... });
_converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });

chatRoomInitialized

Triggered once a _converse.ChatRoom has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomInitialized', model => { ... });

chatRoomInitialized

Triggered once a _converse.ChatRoom has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomInitialized', model => { ... });

chatRoomMessageInitialized

Triggered once a { @link _converse.ChatRoomMessage } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomMessageInitialized', model => { ... });

chatRoomMessageInitialized

Triggered once a { @link _converse.ChatRoomMessage } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomMessageInitialized', model => { ... });

chatRoomViewInitialized

Triggered once a _converse.ChatRoomView has been opened

Type:
Source:
Example
_converse.api.listen.on('chatRoomViewInitialized', view => { ... });

clearSession

Synchronouse event triggered once the user session has been cleared, for example when the user has logged out or when Converse has disconnected for some other reason.

Source:

clearSession

Synchronouse event triggered once the user session has been cleared, for example when the user has logged out or when Converse has disconnected for some other reason.

Source:

clientConfigInitialized

Triggered once the XMPP-client configuration has been initialized. The client configuration is independent of any particular and its values persist across user sessions.

Source:
Example
_converse.api.listen.on('clientConfigInitialized', () => { ... });

clientConfigInitialized

Triggered once the XMPP-client configuration has been initialized. The client configuration is independent of any particular and its values persist across user sessions.

Source:
Example
_converse.api.listen.on('clientConfigInitialized', () => { ... });

confirmDirectMUCInvitation

Hook which is used to gather confirmation whether a direct MUC invitation should be accepted or not.

It's meant for consumers of @converse/headless to subscribe to this hook and then ask the user to confirm.

Source:

confirmDirectMUCInvitation

Hook which is used to gather confirmation whether a direct MUC invitation should be accepted or not.

It's meant for consumers of @converse/headless to subscribe to this hook and then ask the user to confirm.

Source:

connectionInitialized

Triggered once the Connection constructor has been initialized, which will be responsible for managing the connection to the XMPP server.

Source:

connectionInitialized

Triggered once the Connection constructor has been initialized, which will be responsible for managing the connection to the XMPP server.

Source:

constructedMUCPresence

Hook which allows plugins to update an outgoing MUC join presence stanza

Parameters:
Name Type Description
_converse.ChatRoom

The MUC from which this message stanza is being sent.

stanza Element

The stanza which will be sent out

Source:

constructedMUCPresence

Hook which allows plugins to update an outgoing MUC join presence stanza

Parameters:
Name Type Description
_converse.ChatRoom

The MUC from which this message stanza is being sent.

stanza Element

The stanza which will be sent out

Source:

constructedPresence

Hook which allows plugins to modify a presence stanza

Source:

constructedPresence

Hook which allows plugins to modify a presence stanza

Source:

contactPresenceChanged

When a contact's presence status has changed. The presence status is either online, offline, dnd, away or xa.

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactPresenceChanged', contact => { ... });

contactPresenceChanged

When a contact's presence status has changed. The presence status is either online, offline, dnd, away or xa.

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactPresenceChanged', contact => { ... });

contactRequest

Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactRequest', contact => { ... });

contactRequest

Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactRequest', contact => { ... });

controlBoxInitialized

Triggered when the _converse.ControlBoxView has been initialized and therefore exists. The controlbox contains the login and register forms when the user is logged out and a list of the user's contacts and group chats when logged in.

Type:
  • _converse.ControlBoxView
Source:
Example
_converse.api.listen.on('controlBoxInitialized', view => { ... });

controlBoxOpened

Triggered once the controlbox has been opened

Type:
  • _converse.ControlBox
Source:

createMessageStanza

Hook which allows plugins to update an outgoing message stanza

Parameters:
Name Type Description
_converse.ChatBox | _converse.ChatRoom

The chat from which this message stanza is being sent.

data Object

Message data

Properties
Name Type Description
message _converse.Message | _converse.ChatRoomMessage

The message object from which the stanza is created and which gets persisted to storage.

stanza Strophe.Builder

The stanza that will be sent out, as a Strophe.Builder object. You can use the Strophe.Builder functions to extend the stanza. See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions

Source:

createMessageStanza

Hook which allows plugins to update an outgoing message stanza

Parameters:
Name Type Description
_converse.ChatBox | _converse.ChatRoom

The chat from which this message stanza is being sent.

data Object

Message data

Properties
Name Type Description
message _converse.Message | _converse.ChatRoomMessage

The message object from which the stanza is created and which gets persisted to storage.

stanza Strophe.Builder

The stanza that will be sent out, as a Strophe.Builder object. You can use the Strophe.Builder functions to extend the stanza. See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions

Source:

discoExtensionFieldDiscovered

Triggered when Converse has learned of a disco extension field. See XEP-0030.

Source:
Example
_converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });

discoExtensionFieldDiscovered

Triggered when Converse has learned of a disco extension field. See XEP-0030.

Source:
Example
_converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });

discoInitialized

Triggered once the converse-disco plugin has been initialized and the _converse.disco_entities collection will be available and populated with at least the service discovery features of the user's own server.

Source:
Example
_converse.api.listen.on('discoInitialized', () => { ... });

discoInitialized

Triggered once the converse-disco plugin has been initialized and the _converse.disco_entities collection will be available and populated with at least the service discovery features of the user's own server.

Source:
Example
_converse.api.listen.on('discoInitialized', () => { ... });

disconnected

Triggered after converse.js has disconnected from the XMPP server.

Source:
Example
_converse.api.listen.on('disconnected', () => { ... });

disconnected

Triggered after converse.js has disconnected from the XMPP server.

Source:
Example
_converse.api.listen.on('disconnected', () => { ... });

enteredNewRoom

Triggered when the user has entered a new MUC

Type:
Source:
Example
_converse.api.listen.on('enteredNewRoom', model => { ... });

enteredNewRoom

Triggered when the user has entered a new MUC

Type:
Source:
Example
_converse.api.listen.on('enteredNewRoom', model => { ... });

getHeadingButtons

Hook which allows plugins to add more buttons to a chat's heading.

Note: This hook is fired for both 1 on 1 chats and groupchats. If you only care about one, you need to add a check in your code.

Parameters:
Name Type Description
el HTMLElement

The converse-chat (or converse-muc) DOM element that represents the chat

An Array.<HeadingButtonAttributes>

array of the existing buttons. New buttons may be added, and existing ones removed or modified.

Source:
Example
api.listen.on('getHeadingButtons', (el, buttons) => {
     buttons.push({
         'i18n_title': __('Foo'),
         'i18n_text': __('Foo Bar'),
         'handler': ev => alert('Foo!'),
         'a_class': 'toggle-foo',
         'icon_class': 'fa-foo',
         'name': 'foo'
     });
     return buttons;
 });

getMessageActionButtons

Hook which allows plugins to add more message action buttons

Source:
Example
api.listen.on('getMessageActionButtons', (el, buttons) => {
     buttons.push({
         'i18n_text': 'Foo',
         'handler': ev => alert('Foo!'),
         'button_class': 'chat-msg__action-foo',
         'icon_class': 'fa fa-check',
         'name': 'foo'
     });
     return buttons;
 });

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message. These attributes get set on the { @link _converse.Message } or { @link _converse.ChatRoomMessage } and persisted to storage.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this message will be sent.

attrs MessageAttributes

The message attributes, from which the stanza will be created.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message. These attributes get set on the { @link _converse.Message } or { @link _converse.ChatRoomMessage } and persisted to storage.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this message will be sent.

attrs MessageAttributes

The message attributes, from which the stanza will be created.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message.

Source:

getToolbarButtons

Hook which allows plugins to add more buttons to a chat's toolbar

Source:
Example
api.listen.on('getToolbarButtons', (toolbar_el, buttons) {
     buttons.push(html`
         <button @click=${() => alert('Foo!')}>Foo</button>`
     );
     return buttons;
 }

headlinesBoxViewInitialized

Triggered once the { @link _converse.HeadlinesFeedView } has been initialized

Type:
  • _converse.HeadlinesFeedView
Source:
Example
_converse.api.listen.on('headlinesBoxViewInitialized', view => { ... });

headlinesFeedInitialized

Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('headlinesFeedInitialized', model => { ... });

headlinesFeedInitialized

Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('headlinesFeedInitialized', model => { ... });

historyPruned

Triggered once the message history has been pruned, i.e. once older messages have been removed to keep the number of messages below the value set in prune_messages_above.

Type:
Source:
Example
_converse.api.listen.on('historyPruned', this => { ... });

historyPruned

Triggered once the message history has been pruned, i.e. once older messages have been removed to keep the number of messages below the value set in prune_messages_above.

Type:
Source:
Example
_converse.api.listen.on('historyPruned', this => { ... });

initialized

Triggered after the connection has been established and Converse has got all its ducks in a row.

Source:

initialized

Triggered once converse.initialize has finished.

Source:

initialized

Triggered after the connection has been established and Converse has got all its ducks in a row.

Source:

initialized

Triggered once converse.initialize has finished.

Source:

logout

Triggered once the user has logged out.

Source:

logout

Triggered once the user has logged out.

Source:

membersFetched

Triggered once the member lists for this MUC have been fetched and processed.

Source:
Example
_converse.api.listen.on('membersFetched', () => { ... });

membersFetched

Triggered once the member lists for this MUC have been fetched and processed.

Source:
Example
_converse.api.listen.on('membersFetched', () => { ... });

message

Triggered when a message stanza is been received and processed.

Type:
  • object
Properties:
Name Type Description
data module:converse-chat~MessageData
Source:

message

Triggered when a groupchat message stanza has been received and parsed.

Type:
  • object
Properties:
Name Type Description
data module:converse-muc~MUCMessageData
Source:

message

Triggered when a message stanza is been received and processed.

Type:
  • object
Properties:
Name Type Description
data module:converse-chat~MessageData
Source:

message

Triggered when a groupchat message stanza has been received and parsed.

Type:
  • object
Properties:
Name Type Description
data module:converse-muc~MUCMessageData
Source:

messageInitialized

Triggered once a _converse.Message has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('messageInitialized', model => { ... });

messageInitialized

Triggered once a _converse.Message has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('messageInitialized', model => { ... });

messageNotification

Triggered when a notification (sound or HTML5 notification) for a new message has will be made.

Type:
Source:
Example
_converse.api.listen.on('messageNotification', data => { ... });

noResumeableBOSHSession

Triggered when fetching prebind tokens failed

Type:
Source:
Example
_converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });

noResumeableBOSHSession

Triggered when fetching prebind tokens failed

Type:
Source:
Example
_converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });

occupantModalInitialized

Triggered once the OccupantModal has been initialized

Type:
  • Object
Source:
Example
_converse.api.listen.on('occupantModalInitialized', data);

onChatReconnected

Triggered whenever a _converse.ChatBox instance has reconnected after an outage

Type:
Source:
Example
_converse.api.listen.on('onChatReconnected', chat => { ... });

onChatReconnected

Triggered whenever a _converse.ChatBox instance has reconnected after an outage

Type:
Source:
Example
_converse.api.listen.on('onChatReconnected', chat => { ... });

parseMUCMessage

Hook which allows plugins to add additional parsing

Source:

parseMUCMessage

Hook which allows plugins to add additional parsing

Source:

parseMessage

Hook which allows plugins to add additional parsing

Source:

parseMessage

Hook which allows plugins to add additional parsing

Source:

parseMessageForCommands

Hook which allows plugins to add more commands to a chat's textbox. Data provided is the chatbox model and the text typed - {model, text}. Check handled to see if the hook was already handled.

Source:
Example
api.listen.on('parseMessageForCommands', (data, handled) {
     if (!handled) {
        const command = (data.text.match(/^\/([a-zA-Z]*) ?/) || ['']).pop().toLowerCase();
        // custom code comes here
     }
     return handled;
 }

pluginsInitialized

Triggered once all plugins have been initialized. This is a useful event if you want to register event handlers but would like your own handlers to be overridable by plugins. In that case, you need to first wait until all plugins have been initialized, so that their overrides are active. One example where this is used is in converse-notifications.js`.

Also available as an ES2015 Promise which can be listened to with _converse.api.waitUntil.

Source:
Example
_converse.api.listen.on('pluginsInitialized', () => { ... });

pluginsInitialized

Triggered once all plugins have been initialized. This is a useful event if you want to register event handlers but would like your own handlers to be overridable by plugins. In that case, you need to first wait until all plugins have been initialized, so that their overrides are active. One example where this is used is in converse-notifications.js`.

Also available as an ES2015 Promise which can be listened to with _converse.api.waitUntil.

Source:
Example
_converse.api.listen.on('pluginsInitialized', () => { ... });

presencesInitialized

Triggered once the _converse.Presences collection has been initialized and its cached data fetched. Returns a boolean indicating whether this event has fired due to Converse having reconnected.

Type:
  • bool
Source:
Example
_converse.api.listen.on('presencesInitialized', reconnecting => { ... });

presencesInitialized

Triggered once the _converse.Presences collection has been initialized and its cached data fetched. Returns a boolean indicating whether this event has fired due to Converse having reconnected.

Type:
  • bool
Source:
Example
_converse.api.listen.on('presencesInitialized', reconnecting => { ... });

privateChatsAutoJoined

Triggered once any private chats have been automatically joined as specified by the auto_join_private_chats setting. See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats

Source:
Examples
_converse.api.listen.on('privateChatsAutoJoined', () => { ... });
_converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });

privateChatsAutoJoined

Triggered once any private chats have been automatically joined as specified by the auto_join_private_chats setting. See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats

Source:
Examples
_converse.api.listen.on('privateChatsAutoJoined', () => { ... });
_converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });

profileModalInitialized

Triggered when the _converse.ProfileModal has been created and initialized.

Type:
  • _converse.XMPPStatus
Source:
Example
_converse.api.listen.on('profileModalInitialized', status => { ... });

reconnected

After the connection has dropped and converse.js has reconnected. Any Strophe stanza handlers (as registered via converse.listen.stanza) will have to be registered anew.

Source:
Example
_converse.api.listen.on('reconnected', () => { ... });

reconnected

After the connection has dropped and converse.js has reconnected. Any Strophe stanza handlers (as registered via converse.listen.stanza) will have to be registered anew.

Source:
Example
_converse.api.listen.on('reconnected', () => { ... });

registeredGlobalEventHandlers

Called once Converse has registered its global event handlers (for events such as window resize or unload). Plugins can listen to this event as cue to register their own global event handlers.

Source:
Example
_converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });

registeredGlobalEventHandlers

Called once Converse has registered its global event handlers (for events such as window resize or unload). Plugins can listen to this event as cue to register their own global event handlers.

Source:
Example
_converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });

renderToolbar

Triggered once the _converse.ChatBoxView's toolbar has been rendered

Type:
Source:
Example
_converse.api.listen.on('renderToolbar', this => { ... });

roomsAutoJoined

Triggered once any rooms that have been configured to be automatically joined, specified via the _auto_join_rooms setting, have been entered.

Source:
Examples
_converse.api.listen.on('roomsAutoJoined', () => { ... });
_converse.api.waitUntil('roomsAutoJoined').then(() => { ... });

roomsAutoJoined

Triggered once any rooms that have been configured to be automatically joined, specified via the _auto_join_rooms setting, have been entered.

Source:
Examples
_converse.api.listen.on('roomsAutoJoined', () => { ... });
_converse.api.waitUntil('roomsAutoJoined').then(() => { ... });

roster

When the roster has been received from the XMPP server. See also the cachedRoster event further up, which gets called instead of roster if its already in sessionStorage.

Type:
  • Element
Source:
Examples
_converse.api.listen.on('roster', iq => { ... });
_converse.api.waitUntil('roster').then(iq => { ... });

roster

When the roster has been received from the XMPP server. See also the cachedRoster event further up, which gets called instead of roster if its already in sessionStorage.

Type:
  • Element
Source:
Examples
_converse.api.listen.on('roster', iq => { ... });
_converse.api.waitUntil('roster').then(iq => { ... });

rosterContactInitialized

Synchronous event which provides a hook for further initializing a RosterContact

Parameters:
Name Type Description
contact _converse.RosterContact
Source:

rosterContactInitialized

Synchronous event which provides a hook for further initializing a RosterContact

Parameters:
Name Type Description
contact _converse.RosterContact
Source:

rosterPush

When the roster receives a push event from server (i.e. new entry in your contacts roster).

Type:
  • Element
Source:
Example
_converse.api.listen.on('rosterPush', iq => { ... });

rosterPush

When the roster receives a push event from server (i.e. new entry in your contacts roster).

Type:
  • Element
Source:
Example
_converse.api.listen.on('rosterPush', iq => { ... });

rosterReadyAfterReconnection

Similar to rosterInitialized, but instead pertaining to reconnection. This event indicates that the roster and its groups are now again available after Converse.js has reconnected.

Source:
Example
_converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });

rosterReadyAfterReconnection

Similar to rosterInitialized, but instead pertaining to reconnection. This event indicates that the roster and its groups are now again available after Converse.js has reconnected.

Source:
Example
_converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });

rosterViewInitialized

Triggered once the _converse.RosterView instance has been created and initialized.

Source:
Example
_converse.api.listen.on('rosterViewInitialized', () => { ... });

sendMessage

Triggered when a message is being sent out

Type:
  • Object
Parameters:
Name Type Description
data Object
Properties:
Name Type Description
data.chatbox _converse.ChatBox | _converse.ChatRoom
data.message _converse.Message | _converse.ChatRoomMessage
Source:

sendMessage

Triggered when a message is being sent out

Type:
  • Object
Parameters:
Name Type Description
data Object
Properties:
Name Type Description
data.chatbox _converse.ChatBox | _converse.ChatRoom
data.message _converse.Message | _converse.ChatRoomMessage
Source:

serviceDiscovered

Triggered when Converse has learned of a service provided by the XMPP server. See XEP-0030.

Type:
  • Model
Source:
Example
_converse.api.listen.on('featuresDiscovered', feature => { ... });

serviceDiscovered

Triggered when Converse has learned of a service provided by the XMPP server. See XEP-0030.

Type:
  • Model
Source:
Example
_converse.api.listen.on('featuresDiscovered', feature => { ... });

setUserJID

Triggered whenever the user's JID has been updated

Source:

setUserJID

Triggered whenever the user's JID has been updated

Source:

shouldNotifyOfGroupMessage

Hook which allows plugins to run further logic to determine whether a notification should be sent out for this message.

Source:
Example
api.listen.on('shouldNotifyOfGroupMessage', (should_notify) => {
     return should_notify && flurb === floob;
 });

startDiagonalResize

Triggered once the user starts to diagonally resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startDiagonalResize', (view) => { ... });

startHorizontalResize

Triggered once the user starts to horizontally resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startHorizontalResize', (view) => { ... });

startVerticalResize

Triggered once the user starts to vertically resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startVerticalResize', (view) => { ... });

statusInitialized

Triggered when the user's own chat status has been initialized.

Source:
Examples
_converse.api.listen.on('statusInitialized', status => { ... });
_converse.api.waitUntil('statusInitialized').then(() => { ... });

statusInitialized

Triggered when the user's own chat status has been initialized.

Source:
Examples
_converse.api.listen.on('statusInitialized', status => { ... });
_converse.api.waitUntil('statusInitialized').then(() => { ... });

streamFeaturesAdded

Triggered as soon as the stream features are known. If you want to check whether a stream feature is supported before proceeding, then you'll first want to wait for this event.

Source:
Example
_converse.api.listen.on('streamFeaturesAdded', () => { ... });

streamFeaturesAdded

Triggered as soon as the stream features are known. If you want to check whether a stream feature is supported before proceeding, then you'll first want to wait for this event.

Source:
Example
_converse.api.listen.on('streamFeaturesAdded', () => { ... });

streamResumptionFailed

Triggered when the XEP-0198 stream could not be resumed.

Source:

streamResumptionFailed

Triggered when the XEP-0198 stream could not be resumed.

Source:

userDetailsModalInitialized

Triggered once the UserDetailsModal has been initialized

Type:
Source:
Example
_converse.api.listen.on('userDetailsModalInitialized', (chatbox) => { ... });

userSessionInitialized

Triggered once the user's session has been initialized. The session is a cache which stores information about the user's current session.

Source:

userSessionInitialized

Triggered once the user's session has been initialized. The session is a cache which stores information about the user's current session.

Source:

will-reconnect

Triggered when the connection has dropped, but Converse will attempt to reconnect again.

Source:

will-reconnect

Triggered when the connection has dropped, but Converse will attempt to reconnect again.

Source:

windowStateChanged

Triggered when window state has changed. Used to determine when a user left the page and when came back.

Type:
  • object
Source:
Example
_converse.api.listen.on('windowStateChanged', obj => { ... });

windowStateChanged

Triggered when window state has changed. Used to determine when a user left the page and when came back.

Type:
  • object
Source:
Example
_converse.api.listen.on('windowStateChanged', obj => { ... });

_converse

Custom error for indicating timeouts

Source:

Namespaces

ChatBox
ChatBox
ChatBoxView
ChatRoom
ChatRoom
ChatRoomMessage
ChatRoomMessage
ChatRoomMessages
ChatRoomMessages
ChatRoomOccupant
ChatRoomOccupant
ChatRoomOccupants
ChatRoomOccupants
Device
DeviceList
DeviceLists
EmojiPicker
EmojiPicker
HeadlinesFeed
HeadlinesFeed
HeadlinesFeedsList
Message
Message
RegisterPanel
RosterView
VCard
VCard
api
api

Methods

(private, static) __(str)

Translate the given string based on the current locale.

Parameters:
Name Type Description
str String
Source:

(private, static) __(str)

Translate the given string based on the current locale.

Parameters:
Name Type Description
str String
Source:

(private, static) ___(str)

A no-op method which is used to signal to gettext that the passed in string should be included in the pot translation file.

In contrast to the double-underscore method, the triple underscore method doesn't actually translate the strings.

One reason for this method might be because we're using strings we cannot send to the translation function because they require variable interpolation and we don't yet have the variables at scan time.

Parameters:
Name Type Description
str String
Source:

(private, static) ___(str)

A no-op method which is used to signal to gettext that the passed in string should be included in the pot translation file.

In contrast to the double-underscore method, the triple underscore method doesn't actually translate the strings.

One reason for this method might be because we're using strings we cannot send to the translation function because they require variable interpolation and we don't yet have the variables at scan time.

Parameters:
Name Type Description
str String
Source:

(static) exports.isInfoVisible(code)

Determines info message visibility based on muc_show_info_messages configuration setting

Parameters:
Name Type Description
code *
Source:

(static) isInfoVisible(code)

Determines info message visibility based on muc_show_info_messages configuration setting

Parameters:
Name Type Description
code *
Source:

Events

MAMResult

Synchronous event which allows listeners to first do some work based on the MAM result before calling the handlers here.

Source:

MAMResult

Synchronous event which allows listeners to first do some work based on the MAM result before calling the handlers here.

Source:

OMEMOInitialized

Triggered once OMEMO support has been initialized

Source:
Example
_converse.api.listen.on('OMEMOInitialized', () => { ... });

VCardsInitialized

Triggered as soon as the _converse.vcards collection has been initialized and populated from cache.

Source:

VCardsInitialized

Triggered as soon as the _converse.vcards collection has been initialized and populated from cache.

Source:

addClientFeatures

Triggered in converse-disco once the core disco features of Converse have been added.

Source:
Example
_converse.api.listen.on('addClientFeatures', () => { ... });

addClientFeatures

Triggered in converse-disco once the core disco features of Converse have been added.

Source:
Example
_converse.api.listen.on('addClientFeatures', () => { ... });

afterFileUploaded

Hook which allows plugins to change the attributes saved on the message once a file has been uploaded.

Source:

afterFileUploaded

Hook which allows plugins to change the attributes saved on the message once a file has been uploaded.

Source:

afterMessageBodyTransformed

Synchronous event which provides a hook for transforming a chat message's body text after the default transformations have been applied.

Parameters:
Name Type Description
text RichText

A RichText instance. You can call RichText#addTemplateResult on it in order to add TemplateResult objects meant to render rich parts of the message.

Source:
Example
_converse.api.listen.on('afterMessageBodyTransformed', (view, text) => { ... });

afterMessagesFetched

Triggered whenever a { @link _converse.ChatBox } or ${ @link _converse.ChatRoom } has fetched its messages from the local cache.

Type:
Source:
Example
_converse.api.listen.on('afterMessagesFetched', (chat) => { ... });

afterMessagesFetched

Triggered whenever a { @link _converse.ChatBox } or ${ @link _converse.ChatRoom } has fetched its messages from the local cache.

Type:
Source:
Example
_converse.api.listen.on('afterMessagesFetched', (chat) => { ... });

afterResourceBinding

Synchronous event triggered after we've sent an IQ to bind the user's JID resource for this session.

Source:

afterResourceBinding

Synchronous event triggered after we've sent an IQ to bind the user's JID resource for this session.

Source:

beforeFetchLoginCredentials

Hook which allows modifying the server request

Source:

beforeFetchLoginCredentials

Hook which allows modifying the server request

Source:

beforeFileUpload

Hook which allows plugins to transform files before they'll be uploaded. The main use-case is to encrypt the files.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this file will be uploaded.

file File

The file that will be uploaded

Source:

beforeFileUpload

Hook which allows plugins to transform files before they'll be uploaded. The main use-case is to encrypt the files.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this file will be uploaded.

file File

The file that will be uploaded

Source:

beforeLogout

Triggered before the user is logged out

Source:

beforeLogout

Triggered before the user is logged out

Source:

beforeMessageBodyTransformed

Synchronous event which provides a hook for transforming a chat message's body text before the default transformations have been applied.

Parameters:
Name Type Description
text RichText

A RichText instance. You can call RichText#addTemplateResult on it in order to add TemplateResult objects meant to render rich parts of the message.

Source:
Example
_converse.api.listen.on('beforeMessageBodyTransformed', (view, text) => { ... });

beforeResourceBinding

Synchronous event triggered before we send an IQ to bind the user's JID resource for this session.

Source:

beforeResourceBinding

Synchronous event triggered before we send an IQ to bind the user's JID resource for this session.

Source:

bookmarksInitialized

Triggered once the _converse.Bookmarks collection has been created and cached bookmarks have been fetched.

Type:
  • _converse.Bookmarks
Source:
Example
_converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });

bookmarksInitialized

Triggered once the _converse.Bookmarks collection has been created and cached bookmarks have been fetched.

Type:
  • _converse.Bookmarks
Source:
Example
_converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });

cachedRoster

The contacts roster has been retrieved from the local cache (sessionStorage).

Type:
Source:
Examples
_converse.api.listen.on('cachedRoster', (items) => { ... });
_converse.api.waitUntil('cachedRoster').then(items => { ... });

cachedRoster

The contacts roster has been retrieved from the local cache (sessionStorage).

Type:
Source:
Examples
_converse.api.listen.on('cachedRoster', (items) => { ... });
_converse.api.waitUntil('cachedRoster').then(items => { ... });

callButtonClicked

When a call button (i.e. with class .toggle-call) on a chatbox has been clicked.

Type:
  • object
Properties:
Name Type Description
_converse.connection Strophe.Connection

The XMPP Connection object

_converse.connection _converse.ChatBox | _converse.ChatRoom

The XMPP Connection object

Source:
Example
_converse.api.listen.on('callButtonClicked', (connection, model) => { ... });

chatBoxBlurred

Triggered when the focus has been removed from a particular chat.

Type:
Source:
Example
_converse.api.listen.on('chatBoxBlurred', (view, event) => { ... });

chatBoxClosed

Triggered once a chatbox has been closed.

Type:
Source:
Example
_converse.api.listen.on('chatBoxClosed', chat => { ... });

chatBoxClosed

Triggered once a chatbox has been closed.

Type:
Source:
Example
_converse.api.listen.on('chatBoxClosed', chat => { ... });

chatBoxFocused

Triggered when the focus has been moved to a particular chat.

Type:
Source:
Example
_converse.api.listen.on('chatBoxFocused', (view, event) => { ... });

chatBoxInitialized

Triggered once a _converse.ChatBox has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatBoxInitialized', model => { ... });

chatBoxInitialized

Triggered once a _converse.ChatBox has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatBoxInitialized', model => { ... });

chatBoxMaximized

Triggered when a previously minimized chat gets maximized

Type:
Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

Triggered once the _converse.RosterContacts been created, but not yet populated with data. This event is useful when you want to create views for these collections.

Source:
Examples
_converse.api.listen.on('rosterInitialized', () => { ... });
_converse.api.waitUntil('rosterInitialized').then(() => { ... });

chatBoxMaximized

After the user has sent out a direct invitation (as per XEP-0249), to a roster contact, asking them to join a room.

Type:
  • object
Properties:
Name Type Description
room _converse.ChatRoom
recipient string

The JID of the person being invited

reason string

The original reason for the invitation

Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

After the user has sent out a direct invitation (as per XEP-0249), to a roster contact, asking them to join a room.

Type:
  • object
Properties:
Name Type Description
room _converse.ChatRoom
recipient string

The JID of the person being invited

reason string

The original reason for the invitation

Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

Triggered once the _converse.RosterContacts been created, but not yet populated with data. This event is useful when you want to create views for these collections.

Source:
Examples
_converse.api.listen.on('rosterInitialized', () => { ... });
_converse.api.waitUntil('rosterInitialized').then(() => { ... });

chatBoxMinimized

Triggered when a previously maximized chat gets Minimized

Type:
Source:
Example
_converse.api.listen.on('chatBoxMinimized', view => { ... });

chatBoxScrolledDown

Triggered once the converse-chat-content element has been scrolled down to the bottom.

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom

The chat model

Source:
Example
_converse.api.listen.on('chatBoxScrolledDown', obj => { ... });

chatBoxScrolledUp

Triggered once the chat's message area has been scrolled to the top

Properties:
Name Type Description
view _converse.ChatBoxView | _converse.ChatRoomView
Source:
Example
_converse.api.listen.on('chatBoxScrolledUp', obj => { ... });

chatBoxViewInitialized

Triggered once the _converse.ChatBoxView has been initialized

Type:
Source:
Example
_converse.api.listen.on('chatBoxViewInitialized', view => { ... });

chatBoxViewsInitialized

Triggered once the _converse.ChatBoxViews view-colleciton has been initialized

Source:
Example
_converse.api.listen.on('chatBoxViewsInitialized', () => { ... });

chatBoxesFetched

Triggered once all chat boxes have been recreated from the browser cache

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom
stanza Element
Source:
Examples
_converse.api.listen.on('chatBoxesFetched', obj => { ... });
_converse.api.waitUntil('chatBoxesFetched').then(() => { ... });

chatBoxesFetched

Triggered once all chat boxes have been recreated from the browser cache

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom
stanza Element
Source:
Examples
_converse.api.listen.on('chatBoxesFetched', obj => { ... });
_converse.api.waitUntil('chatBoxesFetched').then(() => { ... });

chatBoxesInitialized

Triggered once the _converse.ChatBoxes collection has been initialized.

Source:
Examples
_converse.api.listen.on('chatBoxesInitialized', () => { ... });
_converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });

chatBoxesInitialized

Triggered once the _converse.ChatBoxes collection has been initialized.

Source:
Examples
_converse.api.listen.on('chatBoxesInitialized', () => { ... });
_converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });

chatRoomInitialized

Triggered once a _converse.ChatRoom has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomInitialized', model => { ... });

chatRoomInitialized

Triggered once a _converse.ChatRoom has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomInitialized', model => { ... });

chatRoomMessageInitialized

Triggered once a { @link _converse.ChatRoomMessage } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomMessageInitialized', model => { ... });

chatRoomMessageInitialized

Triggered once a { @link _converse.ChatRoomMessage } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomMessageInitialized', model => { ... });

chatRoomViewInitialized

Triggered once a _converse.ChatRoomView has been opened

Type:
Source:
Example
_converse.api.listen.on('chatRoomViewInitialized', view => { ... });

clearSession

Synchronouse event triggered once the user session has been cleared, for example when the user has logged out or when Converse has disconnected for some other reason.

Source:

clearSession

Synchronouse event triggered once the user session has been cleared, for example when the user has logged out or when Converse has disconnected for some other reason.

Source:

clientConfigInitialized

Triggered once the XMPP-client configuration has been initialized. The client configuration is independent of any particular and its values persist across user sessions.

Source:
Example
_converse.api.listen.on('clientConfigInitialized', () => { ... });

clientConfigInitialized

Triggered once the XMPP-client configuration has been initialized. The client configuration is independent of any particular and its values persist across user sessions.

Source:
Example
_converse.api.listen.on('clientConfigInitialized', () => { ... });

confirmDirectMUCInvitation

Hook which is used to gather confirmation whether a direct MUC invitation should be accepted or not.

It's meant for consumers of @converse/headless to subscribe to this hook and then ask the user to confirm.

Source:

confirmDirectMUCInvitation

Hook which is used to gather confirmation whether a direct MUC invitation should be accepted or not.

It's meant for consumers of @converse/headless to subscribe to this hook and then ask the user to confirm.

Source:

connectionInitialized

Triggered once the Connection constructor has been initialized, which will be responsible for managing the connection to the XMPP server.

Source:

connectionInitialized

Triggered once the Connection constructor has been initialized, which will be responsible for managing the connection to the XMPP server.

Source:

constructedMUCPresence

Hook which allows plugins to update an outgoing MUC join presence stanza

Parameters:
Name Type Description
_converse.ChatRoom

The MUC from which this message stanza is being sent.

stanza Element

The stanza which will be sent out

Source:

constructedMUCPresence

Hook which allows plugins to update an outgoing MUC join presence stanza

Parameters:
Name Type Description
_converse.ChatRoom

The MUC from which this message stanza is being sent.

stanza Element

The stanza which will be sent out

Source:

constructedPresence

Hook which allows plugins to modify a presence stanza

Source:

constructedPresence

Hook which allows plugins to modify a presence stanza

Source:

contactPresenceChanged

When a contact's presence status has changed. The presence status is either online, offline, dnd, away or xa.

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactPresenceChanged', contact => { ... });

contactPresenceChanged

When a contact's presence status has changed. The presence status is either online, offline, dnd, away or xa.

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactPresenceChanged', contact => { ... });

contactRequest

Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactRequest', contact => { ... });

contactRequest

Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactRequest', contact => { ... });

controlBoxInitialized

Triggered when the _converse.ControlBoxView has been initialized and therefore exists. The controlbox contains the login and register forms when the user is logged out and a list of the user's contacts and group chats when logged in.

Type:
  • _converse.ControlBoxView
Source:
Example
_converse.api.listen.on('controlBoxInitialized', view => { ... });

controlBoxOpened

Triggered once the controlbox has been opened

Type:
  • _converse.ControlBox
Source:

createMessageStanza

Hook which allows plugins to update an outgoing message stanza

Parameters:
Name Type Description
_converse.ChatBox | _converse.ChatRoom

The chat from which this message stanza is being sent.

data Object

Message data

Properties
Name Type Description
message _converse.Message | _converse.ChatRoomMessage

The message object from which the stanza is created and which gets persisted to storage.

stanza Strophe.Builder

The stanza that will be sent out, as a Strophe.Builder object. You can use the Strophe.Builder functions to extend the stanza. See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions

Source:

createMessageStanza

Hook which allows plugins to update an outgoing message stanza

Parameters:
Name Type Description
_converse.ChatBox | _converse.ChatRoom

The chat from which this message stanza is being sent.

data Object

Message data

Properties
Name Type Description
message _converse.Message | _converse.ChatRoomMessage

The message object from which the stanza is created and which gets persisted to storage.

stanza Strophe.Builder

The stanza that will be sent out, as a Strophe.Builder object. You can use the Strophe.Builder functions to extend the stanza. See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions

Source:

discoExtensionFieldDiscovered

Triggered when Converse has learned of a disco extension field. See XEP-0030.

Source:
Example
_converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });

discoExtensionFieldDiscovered

Triggered when Converse has learned of a disco extension field. See XEP-0030.

Source:
Example
_converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });

discoInitialized

Triggered once the converse-disco plugin has been initialized and the _converse.disco_entities collection will be available and populated with at least the service discovery features of the user's own server.

Source:
Example
_converse.api.listen.on('discoInitialized', () => { ... });

discoInitialized

Triggered once the converse-disco plugin has been initialized and the _converse.disco_entities collection will be available and populated with at least the service discovery features of the user's own server.

Source:
Example
_converse.api.listen.on('discoInitialized', () => { ... });

disconnected

Triggered after converse.js has disconnected from the XMPP server.

Source:
Example
_converse.api.listen.on('disconnected', () => { ... });

disconnected

Triggered after converse.js has disconnected from the XMPP server.

Source:
Example
_converse.api.listen.on('disconnected', () => { ... });

enteredNewRoom

Triggered when the user has entered a new MUC

Type:
Source:
Example
_converse.api.listen.on('enteredNewRoom', model => { ... });

enteredNewRoom

Triggered when the user has entered a new MUC

Type:
Source:
Example
_converse.api.listen.on('enteredNewRoom', model => { ... });

getHeadingButtons

Hook which allows plugins to add more buttons to a chat's heading.

Note: This hook is fired for both 1 on 1 chats and groupchats. If you only care about one, you need to add a check in your code.

Parameters:
Name Type Description
el HTMLElement

The converse-chat (or converse-muc) DOM element that represents the chat

An Array.<HeadingButtonAttributes>

array of the existing buttons. New buttons may be added, and existing ones removed or modified.

Source:
Example
api.listen.on('getHeadingButtons', (el, buttons) => {
     buttons.push({
         'i18n_title': __('Foo'),
         'i18n_text': __('Foo Bar'),
         'handler': ev => alert('Foo!'),
         'a_class': 'toggle-foo',
         'icon_class': 'fa-foo',
         'name': 'foo'
     });
     return buttons;
 });

getMessageActionButtons

Hook which allows plugins to add more message action buttons

Source:
Example
api.listen.on('getMessageActionButtons', (el, buttons) => {
     buttons.push({
         'i18n_text': 'Foo',
         'handler': ev => alert('Foo!'),
         'button_class': 'chat-msg__action-foo',
         'icon_class': 'fa fa-check',
         'name': 'foo'
     });
     return buttons;
 });

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message. These attributes get set on the { @link _converse.Message } or { @link _converse.ChatRoomMessage } and persisted to storage.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this message will be sent.

attrs MessageAttributes

The message attributes, from which the stanza will be created.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message. These attributes get set on the { @link _converse.Message } or { @link _converse.ChatRoomMessage } and persisted to storage.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this message will be sent.

attrs MessageAttributes

The message attributes, from which the stanza will be created.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message.

Source:

getToolbarButtons

Hook which allows plugins to add more buttons to a chat's toolbar

Source:
Example
api.listen.on('getToolbarButtons', (toolbar_el, buttons) {
     buttons.push(html`
         <button @click=${() => alert('Foo!')}>Foo</button>`
     );
     return buttons;
 }

headlinesBoxViewInitialized

Triggered once the { @link _converse.HeadlinesFeedView } has been initialized

Type:
  • _converse.HeadlinesFeedView
Source:
Example
_converse.api.listen.on('headlinesBoxViewInitialized', view => { ... });

headlinesFeedInitialized

Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('headlinesFeedInitialized', model => { ... });

headlinesFeedInitialized

Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('headlinesFeedInitialized', model => { ... });

historyPruned

Triggered once the message history has been pruned, i.e. once older messages have been removed to keep the number of messages below the value set in prune_messages_above.

Type:
Source:
Example
_converse.api.listen.on('historyPruned', this => { ... });

historyPruned

Triggered once the message history has been pruned, i.e. once older messages have been removed to keep the number of messages below the value set in prune_messages_above.

Type:
Source:
Example
_converse.api.listen.on('historyPruned', this => { ... });

initialized

Triggered after the connection has been established and Converse has got all its ducks in a row.

Source:

initialized

Triggered once converse.initialize has finished.

Source:

initialized

Triggered after the connection has been established and Converse has got all its ducks in a row.

Source:

initialized

Triggered once converse.initialize has finished.

Source:

logout

Triggered once the user has logged out.

Source:

logout

Triggered once the user has logged out.

Source:

membersFetched

Triggered once the member lists for this MUC have been fetched and processed.

Source:
Example
_converse.api.listen.on('membersFetched', () => { ... });

membersFetched

Triggered once the member lists for this MUC have been fetched and processed.

Source:
Example
_converse.api.listen.on('membersFetched', () => { ... });

message

Triggered when a message stanza is been received and processed.

Type:
  • object
Properties:
Name Type Description
data module:converse-chat~MessageData
Source:

message

Triggered when a groupchat message stanza has been received and parsed.

Type:
  • object
Properties:
Name Type Description
data module:converse-muc~MUCMessageData
Source:

message

Triggered when a message stanza is been received and processed.

Type:
  • object
Properties:
Name Type Description
data module:converse-chat~MessageData
Source:

message

Triggered when a groupchat message stanza has been received and parsed.

Type:
  • object
Properties:
Name Type Description
data module:converse-muc~MUCMessageData
Source:

messageInitialized

Triggered once a _converse.Message has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('messageInitialized', model => { ... });

messageInitialized

Triggered once a _converse.Message has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('messageInitialized', model => { ... });

messageNotification

Triggered when a notification (sound or HTML5 notification) for a new message has will be made.

Type:
Source:
Example
_converse.api.listen.on('messageNotification', data => { ... });

noResumeableBOSHSession

Triggered when fetching prebind tokens failed

Type:
Source:
Example
_converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });

noResumeableBOSHSession

Triggered when fetching prebind tokens failed

Type:
Source:
Example
_converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });

occupantModalInitialized

Triggered once the OccupantModal has been initialized

Type:
  • Object
Source:
Example
_converse.api.listen.on('occupantModalInitialized', data);

onChatReconnected

Triggered whenever a _converse.ChatBox instance has reconnected after an outage

Type:
Source:
Example
_converse.api.listen.on('onChatReconnected', chat => { ... });

onChatReconnected

Triggered whenever a _converse.ChatBox instance has reconnected after an outage

Type:
Source:
Example
_converse.api.listen.on('onChatReconnected', chat => { ... });

parseMUCMessage

Hook which allows plugins to add additional parsing

Source:

parseMUCMessage

Hook which allows plugins to add additional parsing

Source:

parseMessage

Hook which allows plugins to add additional parsing

Source:

parseMessage

Hook which allows plugins to add additional parsing

Source:

parseMessageForCommands

Hook which allows plugins to add more commands to a chat's textbox. Data provided is the chatbox model and the text typed - {model, text}. Check handled to see if the hook was already handled.

Source:
Example
api.listen.on('parseMessageForCommands', (data, handled) {
     if (!handled) {
        const command = (data.text.match(/^\/([a-zA-Z]*) ?/) || ['']).pop().toLowerCase();
        // custom code comes here
     }
     return handled;
 }

pluginsInitialized

Triggered once all plugins have been initialized. This is a useful event if you want to register event handlers but would like your own handlers to be overridable by plugins. In that case, you need to first wait until all plugins have been initialized, so that their overrides are active. One example where this is used is in converse-notifications.js`.

Also available as an ES2015 Promise which can be listened to with _converse.api.waitUntil.

Source:
Example
_converse.api.listen.on('pluginsInitialized', () => { ... });

pluginsInitialized

Triggered once all plugins have been initialized. This is a useful event if you want to register event handlers but would like your own handlers to be overridable by plugins. In that case, you need to first wait until all plugins have been initialized, so that their overrides are active. One example where this is used is in converse-notifications.js`.

Also available as an ES2015 Promise which can be listened to with _converse.api.waitUntil.

Source:
Example
_converse.api.listen.on('pluginsInitialized', () => { ... });

presencesInitialized

Triggered once the _converse.Presences collection has been initialized and its cached data fetched. Returns a boolean indicating whether this event has fired due to Converse having reconnected.

Type:
  • bool
Source:
Example
_converse.api.listen.on('presencesInitialized', reconnecting => { ... });

presencesInitialized

Triggered once the _converse.Presences collection has been initialized and its cached data fetched. Returns a boolean indicating whether this event has fired due to Converse having reconnected.

Type:
  • bool
Source:
Example
_converse.api.listen.on('presencesInitialized', reconnecting => { ... });

privateChatsAutoJoined

Triggered once any private chats have been automatically joined as specified by the auto_join_private_chats setting. See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats

Source:
Examples
_converse.api.listen.on('privateChatsAutoJoined', () => { ... });
_converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });

privateChatsAutoJoined

Triggered once any private chats have been automatically joined as specified by the auto_join_private_chats setting. See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats

Source:
Examples
_converse.api.listen.on('privateChatsAutoJoined', () => { ... });
_converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });

profileModalInitialized

Triggered when the _converse.ProfileModal has been created and initialized.

Type:
  • _converse.XMPPStatus
Source:
Example
_converse.api.listen.on('profileModalInitialized', status => { ... });

reconnected

After the connection has dropped and converse.js has reconnected. Any Strophe stanza handlers (as registered via converse.listen.stanza) will have to be registered anew.

Source:
Example
_converse.api.listen.on('reconnected', () => { ... });

reconnected

After the connection has dropped and converse.js has reconnected. Any Strophe stanza handlers (as registered via converse.listen.stanza) will have to be registered anew.

Source:
Example
_converse.api.listen.on('reconnected', () => { ... });

registeredGlobalEventHandlers

Called once Converse has registered its global event handlers (for events such as window resize or unload). Plugins can listen to this event as cue to register their own global event handlers.

Source:
Example
_converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });

registeredGlobalEventHandlers

Called once Converse has registered its global event handlers (for events such as window resize or unload). Plugins can listen to this event as cue to register their own global event handlers.

Source:
Example
_converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });

renderToolbar

Triggered once the _converse.ChatBoxView's toolbar has been rendered

Type:
Source:
Example
_converse.api.listen.on('renderToolbar', this => { ... });

roomsAutoJoined

Triggered once any rooms that have been configured to be automatically joined, specified via the _auto_join_rooms setting, have been entered.

Source:
Examples
_converse.api.listen.on('roomsAutoJoined', () => { ... });
_converse.api.waitUntil('roomsAutoJoined').then(() => { ... });

roomsAutoJoined

Triggered once any rooms that have been configured to be automatically joined, specified via the _auto_join_rooms setting, have been entered.

Source:
Examples
_converse.api.listen.on('roomsAutoJoined', () => { ... });
_converse.api.waitUntil('roomsAutoJoined').then(() => { ... });

roster

When the roster has been received from the XMPP server. See also the cachedRoster event further up, which gets called instead of roster if its already in sessionStorage.

Type:
  • Element
Source:
Examples
_converse.api.listen.on('roster', iq => { ... });
_converse.api.waitUntil('roster').then(iq => { ... });

roster

When the roster has been received from the XMPP server. See also the cachedRoster event further up, which gets called instead of roster if its already in sessionStorage.

Type:
  • Element
Source:
Examples
_converse.api.listen.on('roster', iq => { ... });
_converse.api.waitUntil('roster').then(iq => { ... });

rosterContactInitialized

Synchronous event which provides a hook for further initializing a RosterContact

Parameters:
Name Type Description
contact _converse.RosterContact
Source:

rosterContactInitialized

Synchronous event which provides a hook for further initializing a RosterContact

Parameters:
Name Type Description
contact _converse.RosterContact
Source:

rosterPush

When the roster receives a push event from server (i.e. new entry in your contacts roster).

Type:
  • Element
Source:
Example
_converse.api.listen.on('rosterPush', iq => { ... });

rosterPush

When the roster receives a push event from server (i.e. new entry in your contacts roster).

Type:
  • Element
Source:
Example
_converse.api.listen.on('rosterPush', iq => { ... });

rosterReadyAfterReconnection

Similar to rosterInitialized, but instead pertaining to reconnection. This event indicates that the roster and its groups are now again available after Converse.js has reconnected.

Source:
Example
_converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });

rosterReadyAfterReconnection

Similar to rosterInitialized, but instead pertaining to reconnection. This event indicates that the roster and its groups are now again available after Converse.js has reconnected.

Source:
Example
_converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });

rosterViewInitialized

Triggered once the _converse.RosterView instance has been created and initialized.

Source:
Example
_converse.api.listen.on('rosterViewInitialized', () => { ... });

sendMessage

Triggered when a message is being sent out

Type:
  • Object
Parameters:
Name Type Description
data Object
Properties:
Name Type Description
data.chatbox _converse.ChatBox | _converse.ChatRoom
data.message _converse.Message | _converse.ChatRoomMessage
Source:

sendMessage

Triggered when a message is being sent out

Type:
  • Object
Parameters:
Name Type Description
data Object
Properties:
Name Type Description
data.chatbox _converse.ChatBox | _converse.ChatRoom
data.message _converse.Message | _converse.ChatRoomMessage
Source:

serviceDiscovered

Triggered when Converse has learned of a service provided by the XMPP server. See XEP-0030.

Type:
  • Model
Source:
Example
_converse.api.listen.on('featuresDiscovered', feature => { ... });

serviceDiscovered

Triggered when Converse has learned of a service provided by the XMPP server. See XEP-0030.

Type:
  • Model
Source:
Example
_converse.api.listen.on('featuresDiscovered', feature => { ... });

setUserJID

Triggered whenever the user's JID has been updated

Source:

setUserJID

Triggered whenever the user's JID has been updated

Source:

shouldNotifyOfGroupMessage

Hook which allows plugins to run further logic to determine whether a notification should be sent out for this message.

Source:
Example
api.listen.on('shouldNotifyOfGroupMessage', (should_notify) => {
     return should_notify && flurb === floob;
 });

startDiagonalResize

Triggered once the user starts to diagonally resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startDiagonalResize', (view) => { ... });

startHorizontalResize

Triggered once the user starts to horizontally resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startHorizontalResize', (view) => { ... });

startVerticalResize

Triggered once the user starts to vertically resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startVerticalResize', (view) => { ... });

statusInitialized

Triggered when the user's own chat status has been initialized.

Source:
Examples
_converse.api.listen.on('statusInitialized', status => { ... });
_converse.api.waitUntil('statusInitialized').then(() => { ... });

statusInitialized

Triggered when the user's own chat status has been initialized.

Source:
Examples
_converse.api.listen.on('statusInitialized', status => { ... });
_converse.api.waitUntil('statusInitialized').then(() => { ... });

streamFeaturesAdded

Triggered as soon as the stream features are known. If you want to check whether a stream feature is supported before proceeding, then you'll first want to wait for this event.

Source:
Example
_converse.api.listen.on('streamFeaturesAdded', () => { ... });

streamFeaturesAdded

Triggered as soon as the stream features are known. If you want to check whether a stream feature is supported before proceeding, then you'll first want to wait for this event.

Source:
Example
_converse.api.listen.on('streamFeaturesAdded', () => { ... });

streamResumptionFailed

Triggered when the XEP-0198 stream could not be resumed.

Source:

streamResumptionFailed

Triggered when the XEP-0198 stream could not be resumed.

Source:

userDetailsModalInitialized

Triggered once the UserDetailsModal has been initialized

Type:
Source:
Example
_converse.api.listen.on('userDetailsModalInitialized', (chatbox) => { ... });

userSessionInitialized

Triggered once the user's session has been initialized. The session is a cache which stores information about the user's current session.

Source:

userSessionInitialized

Triggered once the user's session has been initialized. The session is a cache which stores information about the user's current session.

Source:

will-reconnect

Triggered when the connection has dropped, but Converse will attempt to reconnect again.

Source:

will-reconnect

Triggered when the connection has dropped, but Converse will attempt to reconnect again.

Source:

windowStateChanged

Triggered when window state has changed. Used to determine when a user left the page and when came back.

Type:
  • object
Source:
Example
_converse.api.listen.on('windowStateChanged', obj => { ... });

windowStateChanged

Triggered when window state has changed. Used to determine when a user left the page and when came back.

Type:
  • object
Source:
Example
_converse.api.listen.on('windowStateChanged', obj => { ... });

_converse

A private, closured object containing the private api (via _converse.api) as well as private methods and internal data-structures.

Source:

Namespaces

ChatBox
ChatBox
ChatBoxView
ChatRoom
ChatRoom
ChatRoomMessage
ChatRoomMessage
ChatRoomMessages
ChatRoomMessages
ChatRoomOccupant
ChatRoomOccupant
ChatRoomOccupants
ChatRoomOccupants
Device
DeviceList
DeviceLists
EmojiPicker
EmojiPicker
HeadlinesFeed
HeadlinesFeed
HeadlinesFeedsList
Message
Message
RegisterPanel
RosterView
VCard
VCard
api
api

Methods

(private, static) __(str)

Translate the given string based on the current locale.

Parameters:
Name Type Description
str String
Source:

(private, static) __(str)

Translate the given string based on the current locale.

Parameters:
Name Type Description
str String
Source:

(private, static) ___(str)

A no-op method which is used to signal to gettext that the passed in string should be included in the pot translation file.

In contrast to the double-underscore method, the triple underscore method doesn't actually translate the strings.

One reason for this method might be because we're using strings we cannot send to the translation function because they require variable interpolation and we don't yet have the variables at scan time.

Parameters:
Name Type Description
str String
Source:

(private, static) ___(str)

A no-op method which is used to signal to gettext that the passed in string should be included in the pot translation file.

In contrast to the double-underscore method, the triple underscore method doesn't actually translate the strings.

One reason for this method might be because we're using strings we cannot send to the translation function because they require variable interpolation and we don't yet have the variables at scan time.

Parameters:
Name Type Description
str String
Source:

(static) exports.isInfoVisible(code)

Determines info message visibility based on muc_show_info_messages configuration setting

Parameters:
Name Type Description
code *
Source:

(static) isInfoVisible(code)

Determines info message visibility based on muc_show_info_messages configuration setting

Parameters:
Name Type Description
code *
Source:

Events

MAMResult

Synchronous event which allows listeners to first do some work based on the MAM result before calling the handlers here.

Source:

MAMResult

Synchronous event which allows listeners to first do some work based on the MAM result before calling the handlers here.

Source:

OMEMOInitialized

Triggered once OMEMO support has been initialized

Source:
Example
_converse.api.listen.on('OMEMOInitialized', () => { ... });

VCardsInitialized

Triggered as soon as the _converse.vcards collection has been initialized and populated from cache.

Source:

VCardsInitialized

Triggered as soon as the _converse.vcards collection has been initialized and populated from cache.

Source:

addClientFeatures

Triggered in converse-disco once the core disco features of Converse have been added.

Source:
Example
_converse.api.listen.on('addClientFeatures', () => { ... });

addClientFeatures

Triggered in converse-disco once the core disco features of Converse have been added.

Source:
Example
_converse.api.listen.on('addClientFeatures', () => { ... });

afterFileUploaded

Hook which allows plugins to change the attributes saved on the message once a file has been uploaded.

Source:

afterFileUploaded

Hook which allows plugins to change the attributes saved on the message once a file has been uploaded.

Source:

afterMessageBodyTransformed

Synchronous event which provides a hook for transforming a chat message's body text after the default transformations have been applied.

Parameters:
Name Type Description
text RichText

A RichText instance. You can call RichText#addTemplateResult on it in order to add TemplateResult objects meant to render rich parts of the message.

Source:
Example
_converse.api.listen.on('afterMessageBodyTransformed', (view, text) => { ... });

afterMessagesFetched

Triggered whenever a { @link _converse.ChatBox } or ${ @link _converse.ChatRoom } has fetched its messages from the local cache.

Type:
Source:
Example
_converse.api.listen.on('afterMessagesFetched', (chat) => { ... });

afterMessagesFetched

Triggered whenever a { @link _converse.ChatBox } or ${ @link _converse.ChatRoom } has fetched its messages from the local cache.

Type:
Source:
Example
_converse.api.listen.on('afterMessagesFetched', (chat) => { ... });

afterResourceBinding

Synchronous event triggered after we've sent an IQ to bind the user's JID resource for this session.

Source:

afterResourceBinding

Synchronous event triggered after we've sent an IQ to bind the user's JID resource for this session.

Source:

beforeFetchLoginCredentials

Hook which allows modifying the server request

Source:

beforeFetchLoginCredentials

Hook which allows modifying the server request

Source:

beforeFileUpload

Hook which allows plugins to transform files before they'll be uploaded. The main use-case is to encrypt the files.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this file will be uploaded.

file File

The file that will be uploaded

Source:

beforeFileUpload

Hook which allows plugins to transform files before they'll be uploaded. The main use-case is to encrypt the files.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this file will be uploaded.

file File

The file that will be uploaded

Source:

beforeLogout

Triggered before the user is logged out

Source:

beforeLogout

Triggered before the user is logged out

Source:

beforeMessageBodyTransformed

Synchronous event which provides a hook for transforming a chat message's body text before the default transformations have been applied.

Parameters:
Name Type Description
text RichText

A RichText instance. You can call RichText#addTemplateResult on it in order to add TemplateResult objects meant to render rich parts of the message.

Source:
Example
_converse.api.listen.on('beforeMessageBodyTransformed', (view, text) => { ... });

beforeResourceBinding

Synchronous event triggered before we send an IQ to bind the user's JID resource for this session.

Source:

beforeResourceBinding

Synchronous event triggered before we send an IQ to bind the user's JID resource for this session.

Source:

bookmarksInitialized

Triggered once the _converse.Bookmarks collection has been created and cached bookmarks have been fetched.

Type:
  • _converse.Bookmarks
Source:
Example
_converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });

bookmarksInitialized

Triggered once the _converse.Bookmarks collection has been created and cached bookmarks have been fetched.

Type:
  • _converse.Bookmarks
Source:
Example
_converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });

cachedRoster

The contacts roster has been retrieved from the local cache (sessionStorage).

Type:
Source:
Examples
_converse.api.listen.on('cachedRoster', (items) => { ... });
_converse.api.waitUntil('cachedRoster').then(items => { ... });

cachedRoster

The contacts roster has been retrieved from the local cache (sessionStorage).

Type:
Source:
Examples
_converse.api.listen.on('cachedRoster', (items) => { ... });
_converse.api.waitUntil('cachedRoster').then(items => { ... });

callButtonClicked

When a call button (i.e. with class .toggle-call) on a chatbox has been clicked.

Type:
  • object
Properties:
Name Type Description
_converse.connection Strophe.Connection

The XMPP Connection object

_converse.connection _converse.ChatBox | _converse.ChatRoom

The XMPP Connection object

Source:
Example
_converse.api.listen.on('callButtonClicked', (connection, model) => { ... });

chatBoxBlurred

Triggered when the focus has been removed from a particular chat.

Type:
Source:
Example
_converse.api.listen.on('chatBoxBlurred', (view, event) => { ... });

chatBoxClosed

Triggered once a chatbox has been closed.

Type:
Source:
Example
_converse.api.listen.on('chatBoxClosed', chat => { ... });

chatBoxClosed

Triggered once a chatbox has been closed.

Type:
Source:
Example
_converse.api.listen.on('chatBoxClosed', chat => { ... });

chatBoxFocused

Triggered when the focus has been moved to a particular chat.

Type:
Source:
Example
_converse.api.listen.on('chatBoxFocused', (view, event) => { ... });

chatBoxInitialized

Triggered once a _converse.ChatBox has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatBoxInitialized', model => { ... });

chatBoxInitialized

Triggered once a _converse.ChatBox has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatBoxInitialized', model => { ... });

chatBoxMaximized

Triggered when a previously minimized chat gets maximized

Type:
Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

Triggered once the _converse.RosterContacts been created, but not yet populated with data. This event is useful when you want to create views for these collections.

Source:
Examples
_converse.api.listen.on('rosterInitialized', () => { ... });
_converse.api.waitUntil('rosterInitialized').then(() => { ... });

chatBoxMaximized

After the user has sent out a direct invitation (as per XEP-0249), to a roster contact, asking them to join a room.

Type:
  • object
Properties:
Name Type Description
room _converse.ChatRoom
recipient string

The JID of the person being invited

reason string

The original reason for the invitation

Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

After the user has sent out a direct invitation (as per XEP-0249), to a roster contact, asking them to join a room.

Type:
  • object
Properties:
Name Type Description
room _converse.ChatRoom
recipient string

The JID of the person being invited

reason string

The original reason for the invitation

Source:
Example
_converse.api.listen.on('chatBoxMaximized', view => { ... });

chatBoxMaximized

Triggered once the _converse.RosterContacts been created, but not yet populated with data. This event is useful when you want to create views for these collections.

Source:
Examples
_converse.api.listen.on('rosterInitialized', () => { ... });
_converse.api.waitUntil('rosterInitialized').then(() => { ... });

chatBoxMinimized

Triggered when a previously maximized chat gets Minimized

Type:
Source:
Example
_converse.api.listen.on('chatBoxMinimized', view => { ... });

chatBoxScrolledDown

Triggered once the converse-chat-content element has been scrolled down to the bottom.

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom

The chat model

Source:
Example
_converse.api.listen.on('chatBoxScrolledDown', obj => { ... });

chatBoxScrolledUp

Triggered once the chat's message area has been scrolled to the top

Properties:
Name Type Description
view _converse.ChatBoxView | _converse.ChatRoomView
Source:
Example
_converse.api.listen.on('chatBoxScrolledUp', obj => { ... });

chatBoxViewInitialized

Triggered once the _converse.ChatBoxView has been initialized

Type:
Source:
Example
_converse.api.listen.on('chatBoxViewInitialized', view => { ... });

chatBoxViewsInitialized

Triggered once the _converse.ChatBoxViews view-colleciton has been initialized

Source:
Example
_converse.api.listen.on('chatBoxViewsInitialized', () => { ... });

chatBoxesFetched

Triggered once all chat boxes have been recreated from the browser cache

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom
stanza Element
Source:
Examples
_converse.api.listen.on('chatBoxesFetched', obj => { ... });
_converse.api.waitUntil('chatBoxesFetched').then(() => { ... });

chatBoxesFetched

Triggered once all chat boxes have been recreated from the browser cache

Type:
  • object
Properties:
Name Type Description
chatbox _converse.ChatBox | _converse.ChatRoom
stanza Element
Source:
Examples
_converse.api.listen.on('chatBoxesFetched', obj => { ... });
_converse.api.waitUntil('chatBoxesFetched').then(() => { ... });

chatBoxesInitialized

Triggered once the _converse.ChatBoxes collection has been initialized.

Source:
Examples
_converse.api.listen.on('chatBoxesInitialized', () => { ... });
_converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });

chatBoxesInitialized

Triggered once the _converse.ChatBoxes collection has been initialized.

Source:
Examples
_converse.api.listen.on('chatBoxesInitialized', () => { ... });
_converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });

chatRoomInitialized

Triggered once a _converse.ChatRoom has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomInitialized', model => { ... });

chatRoomInitialized

Triggered once a _converse.ChatRoom has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomInitialized', model => { ... });

chatRoomMessageInitialized

Triggered once a { @link _converse.ChatRoomMessage } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomMessageInitialized', model => { ... });

chatRoomMessageInitialized

Triggered once a { @link _converse.ChatRoomMessage } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('chatRoomMessageInitialized', model => { ... });

chatRoomViewInitialized

Triggered once a _converse.ChatRoomView has been opened

Type:
Source:
Example
_converse.api.listen.on('chatRoomViewInitialized', view => { ... });

clearSession

Synchronouse event triggered once the user session has been cleared, for example when the user has logged out or when Converse has disconnected for some other reason.

Source:

clearSession

Synchronouse event triggered once the user session has been cleared, for example when the user has logged out or when Converse has disconnected for some other reason.

Source:

clientConfigInitialized

Triggered once the XMPP-client configuration has been initialized. The client configuration is independent of any particular and its values persist across user sessions.

Source:
Example
_converse.api.listen.on('clientConfigInitialized', () => { ... });

clientConfigInitialized

Triggered once the XMPP-client configuration has been initialized. The client configuration is independent of any particular and its values persist across user sessions.

Source:
Example
_converse.api.listen.on('clientConfigInitialized', () => { ... });

confirmDirectMUCInvitation

Hook which is used to gather confirmation whether a direct MUC invitation should be accepted or not.

It's meant for consumers of @converse/headless to subscribe to this hook and then ask the user to confirm.

Source:

confirmDirectMUCInvitation

Hook which is used to gather confirmation whether a direct MUC invitation should be accepted or not.

It's meant for consumers of @converse/headless to subscribe to this hook and then ask the user to confirm.

Source:

connectionInitialized

Triggered once the Connection constructor has been initialized, which will be responsible for managing the connection to the XMPP server.

Source:

connectionInitialized

Triggered once the Connection constructor has been initialized, which will be responsible for managing the connection to the XMPP server.

Source:

constructedMUCPresence

Hook which allows plugins to update an outgoing MUC join presence stanza

Parameters:
Name Type Description
_converse.ChatRoom

The MUC from which this message stanza is being sent.

stanza Element

The stanza which will be sent out

Source:

constructedMUCPresence

Hook which allows plugins to update an outgoing MUC join presence stanza

Parameters:
Name Type Description
_converse.ChatRoom

The MUC from which this message stanza is being sent.

stanza Element

The stanza which will be sent out

Source:

constructedPresence

Hook which allows plugins to modify a presence stanza

Source:

constructedPresence

Hook which allows plugins to modify a presence stanza

Source:

contactPresenceChanged

When a contact's presence status has changed. The presence status is either online, offline, dnd, away or xa.

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactPresenceChanged', contact => { ... });

contactPresenceChanged

When a contact's presence status has changed. The presence status is either online, offline, dnd, away or xa.

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactPresenceChanged', contact => { ... });

contactRequest

Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactRequest', contact => { ... });

contactRequest

Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).

Type:
  • _converse.RosterContact
Source:
Example
_converse.api.listen.on('contactRequest', contact => { ... });

controlBoxInitialized

Triggered when the _converse.ControlBoxView has been initialized and therefore exists. The controlbox contains the login and register forms when the user is logged out and a list of the user's contacts and group chats when logged in.

Type:
  • _converse.ControlBoxView
Source:
Example
_converse.api.listen.on('controlBoxInitialized', view => { ... });

controlBoxOpened

Triggered once the controlbox has been opened

Type:
  • _converse.ControlBox
Source:

createMessageStanza

Hook which allows plugins to update an outgoing message stanza

Parameters:
Name Type Description
_converse.ChatBox | _converse.ChatRoom

The chat from which this message stanza is being sent.

data Object

Message data

Properties
Name Type Description
message _converse.Message | _converse.ChatRoomMessage

The message object from which the stanza is created and which gets persisted to storage.

stanza Strophe.Builder

The stanza that will be sent out, as a Strophe.Builder object. You can use the Strophe.Builder functions to extend the stanza. See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions

Source:

createMessageStanza

Hook which allows plugins to update an outgoing message stanza

Parameters:
Name Type Description
_converse.ChatBox | _converse.ChatRoom

The chat from which this message stanza is being sent.

data Object

Message data

Properties
Name Type Description
message _converse.Message | _converse.ChatRoomMessage

The message object from which the stanza is created and which gets persisted to storage.

stanza Strophe.Builder

The stanza that will be sent out, as a Strophe.Builder object. You can use the Strophe.Builder functions to extend the stanza. See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions

Source:

discoExtensionFieldDiscovered

Triggered when Converse has learned of a disco extension field. See XEP-0030.

Source:
Example
_converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });

discoExtensionFieldDiscovered

Triggered when Converse has learned of a disco extension field. See XEP-0030.

Source:
Example
_converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });

discoInitialized

Triggered once the converse-disco plugin has been initialized and the _converse.disco_entities collection will be available and populated with at least the service discovery features of the user's own server.

Source:
Example
_converse.api.listen.on('discoInitialized', () => { ... });

discoInitialized

Triggered once the converse-disco plugin has been initialized and the _converse.disco_entities collection will be available and populated with at least the service discovery features of the user's own server.

Source:
Example
_converse.api.listen.on('discoInitialized', () => { ... });

disconnected

Triggered after converse.js has disconnected from the XMPP server.

Source:
Example
_converse.api.listen.on('disconnected', () => { ... });

disconnected

Triggered after converse.js has disconnected from the XMPP server.

Source:
Example
_converse.api.listen.on('disconnected', () => { ... });

enteredNewRoom

Triggered when the user has entered a new MUC

Type:
Source:
Example
_converse.api.listen.on('enteredNewRoom', model => { ... });

enteredNewRoom

Triggered when the user has entered a new MUC

Type:
Source:
Example
_converse.api.listen.on('enteredNewRoom', model => { ... });

getHeadingButtons

Hook which allows plugins to add more buttons to a chat's heading.

Note: This hook is fired for both 1 on 1 chats and groupchats. If you only care about one, you need to add a check in your code.

Parameters:
Name Type Description
el HTMLElement

The converse-chat (or converse-muc) DOM element that represents the chat

An Array.<HeadingButtonAttributes>

array of the existing buttons. New buttons may be added, and existing ones removed or modified.

Source:
Example
api.listen.on('getHeadingButtons', (el, buttons) => {
     buttons.push({
         'i18n_title': __('Foo'),
         'i18n_text': __('Foo Bar'),
         'handler': ev => alert('Foo!'),
         'a_class': 'toggle-foo',
         'icon_class': 'fa-foo',
         'name': 'foo'
     });
     return buttons;
 });

getMessageActionButtons

Hook which allows plugins to add more message action buttons

Source:
Example
api.listen.on('getMessageActionButtons', (el, buttons) => {
     buttons.push({
         'i18n_text': 'Foo',
         'handler': ev => alert('Foo!'),
         'button_class': 'chat-msg__action-foo',
         'icon_class': 'fa fa-check',
         'name': 'foo'
     });
     return buttons;
 });

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message. These attributes get set on the { @link _converse.Message } or { @link _converse.ChatRoomMessage } and persisted to storage.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this message will be sent.

attrs MessageAttributes

The message attributes, from which the stanza will be created.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message. These attributes get set on the { @link _converse.Message } or { @link _converse.ChatRoomMessage } and persisted to storage.

Parameters:
Name Type Description
chat _converse.ChatBox | _converse.ChatRoom

The chat from which this message will be sent.

attrs MessageAttributes

The message attributes, from which the stanza will be created.

Source:

getOutgoingMessageAttributes

Hook which allows plugins to update the attributes of an outgoing message.

Source:

getToolbarButtons

Hook which allows plugins to add more buttons to a chat's toolbar

Source:
Example
api.listen.on('getToolbarButtons', (toolbar_el, buttons) {
     buttons.push(html`
         <button @click=${() => alert('Foo!')}>Foo</button>`
     );
     return buttons;
 }

headlinesBoxViewInitialized

Triggered once the { @link _converse.HeadlinesFeedView } has been initialized

Type:
  • _converse.HeadlinesFeedView
Source:
Example
_converse.api.listen.on('headlinesBoxViewInitialized', view => { ... });

headlinesFeedInitialized

Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('headlinesFeedInitialized', model => { ... });

headlinesFeedInitialized

Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('headlinesFeedInitialized', model => { ... });

historyPruned

Triggered once the message history has been pruned, i.e. once older messages have been removed to keep the number of messages below the value set in prune_messages_above.

Type:
Source:
Example
_converse.api.listen.on('historyPruned', this => { ... });

historyPruned

Triggered once the message history has been pruned, i.e. once older messages have been removed to keep the number of messages below the value set in prune_messages_above.

Type:
Source:
Example
_converse.api.listen.on('historyPruned', this => { ... });

initialized

Triggered after the connection has been established and Converse has got all its ducks in a row.

Source:

initialized

Triggered once converse.initialize has finished.

Source:

initialized

Triggered after the connection has been established and Converse has got all its ducks in a row.

Source:

initialized

Triggered once converse.initialize has finished.

Source:

logout

Triggered once the user has logged out.

Source:

logout

Triggered once the user has logged out.

Source:

membersFetched

Triggered once the member lists for this MUC have been fetched and processed.

Source:
Example
_converse.api.listen.on('membersFetched', () => { ... });

membersFetched

Triggered once the member lists for this MUC have been fetched and processed.

Source:
Example
_converse.api.listen.on('membersFetched', () => { ... });

message

Triggered when a message stanza is been received and processed.

Type:
  • object
Properties:
Name Type Description
data module:converse-chat~MessageData
Source:

message

Triggered when a groupchat message stanza has been received and parsed.

Type:
  • object
Properties:
Name Type Description
data module:converse-muc~MUCMessageData
Source:

message

Triggered when a message stanza is been received and processed.

Type:
  • object
Properties:
Name Type Description
data module:converse-chat~MessageData
Source:

message

Triggered when a groupchat message stanza has been received and parsed.

Type:
  • object
Properties:
Name Type Description
data module:converse-muc~MUCMessageData
Source:

messageInitialized

Triggered once a _converse.Message has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('messageInitialized', model => { ... });

messageInitialized

Triggered once a _converse.Message has been created and initialized.

Type:
Source:
Example
_converse.api.listen.on('messageInitialized', model => { ... });

messageNotification

Triggered when a notification (sound or HTML5 notification) for a new message has will be made.

Type:
Source:
Example
_converse.api.listen.on('messageNotification', data => { ... });

noResumeableBOSHSession

Triggered when fetching prebind tokens failed

Type:
Source:
Example
_converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });

noResumeableBOSHSession

Triggered when fetching prebind tokens failed

Type:
Source:
Example
_converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });

occupantModalInitialized

Triggered once the OccupantModal has been initialized

Type:
  • Object
Source:
Example
_converse.api.listen.on('occupantModalInitialized', data);

onChatReconnected

Triggered whenever a _converse.ChatBox instance has reconnected after an outage

Type:
Source:
Example
_converse.api.listen.on('onChatReconnected', chat => { ... });

onChatReconnected

Triggered whenever a _converse.ChatBox instance has reconnected after an outage

Type:
Source:
Example
_converse.api.listen.on('onChatReconnected', chat => { ... });

parseMUCMessage

Hook which allows plugins to add additional parsing

Source:

parseMUCMessage

Hook which allows plugins to add additional parsing

Source:

parseMessage

Hook which allows plugins to add additional parsing

Source:

parseMessage

Hook which allows plugins to add additional parsing

Source:

parseMessageForCommands

Hook which allows plugins to add more commands to a chat's textbox. Data provided is the chatbox model and the text typed - {model, text}. Check handled to see if the hook was already handled.

Source:
Example
api.listen.on('parseMessageForCommands', (data, handled) {
     if (!handled) {
        const command = (data.text.match(/^\/([a-zA-Z]*) ?/) || ['']).pop().toLowerCase();
        // custom code comes here
     }
     return handled;
 }

pluginsInitialized

Triggered once all plugins have been initialized. This is a useful event if you want to register event handlers but would like your own handlers to be overridable by plugins. In that case, you need to first wait until all plugins have been initialized, so that their overrides are active. One example where this is used is in converse-notifications.js`.

Also available as an ES2015 Promise which can be listened to with _converse.api.waitUntil.

Source:
Example
_converse.api.listen.on('pluginsInitialized', () => { ... });

pluginsInitialized

Triggered once all plugins have been initialized. This is a useful event if you want to register event handlers but would like your own handlers to be overridable by plugins. In that case, you need to first wait until all plugins have been initialized, so that their overrides are active. One example where this is used is in converse-notifications.js`.

Also available as an ES2015 Promise which can be listened to with _converse.api.waitUntil.

Source:
Example
_converse.api.listen.on('pluginsInitialized', () => { ... });

presencesInitialized

Triggered once the _converse.Presences collection has been initialized and its cached data fetched. Returns a boolean indicating whether this event has fired due to Converse having reconnected.

Type:
  • bool
Source:
Example
_converse.api.listen.on('presencesInitialized', reconnecting => { ... });

presencesInitialized

Triggered once the _converse.Presences collection has been initialized and its cached data fetched. Returns a boolean indicating whether this event has fired due to Converse having reconnected.

Type:
  • bool
Source:
Example
_converse.api.listen.on('presencesInitialized', reconnecting => { ... });

privateChatsAutoJoined

Triggered once any private chats have been automatically joined as specified by the auto_join_private_chats setting. See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats

Source:
Examples
_converse.api.listen.on('privateChatsAutoJoined', () => { ... });
_converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });

privateChatsAutoJoined

Triggered once any private chats have been automatically joined as specified by the auto_join_private_chats setting. See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats

Source:
Examples
_converse.api.listen.on('privateChatsAutoJoined', () => { ... });
_converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });

profileModalInitialized

Triggered when the _converse.ProfileModal has been created and initialized.

Type:
  • _converse.XMPPStatus
Source:
Example
_converse.api.listen.on('profileModalInitialized', status => { ... });

reconnected

After the connection has dropped and converse.js has reconnected. Any Strophe stanza handlers (as registered via converse.listen.stanza) will have to be registered anew.

Source:
Example
_converse.api.listen.on('reconnected', () => { ... });

reconnected

After the connection has dropped and converse.js has reconnected. Any Strophe stanza handlers (as registered via converse.listen.stanza) will have to be registered anew.

Source:
Example
_converse.api.listen.on('reconnected', () => { ... });

registeredGlobalEventHandlers

Called once Converse has registered its global event handlers (for events such as window resize or unload). Plugins can listen to this event as cue to register their own global event handlers.

Source:
Example
_converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });

registeredGlobalEventHandlers

Called once Converse has registered its global event handlers (for events such as window resize or unload). Plugins can listen to this event as cue to register their own global event handlers.

Source:
Example
_converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });

renderToolbar

Triggered once the _converse.ChatBoxView's toolbar has been rendered

Type:
Source:
Example
_converse.api.listen.on('renderToolbar', this => { ... });

roomsAutoJoined

Triggered once any rooms that have been configured to be automatically joined, specified via the _auto_join_rooms setting, have been entered.

Source:
Examples
_converse.api.listen.on('roomsAutoJoined', () => { ... });
_converse.api.waitUntil('roomsAutoJoined').then(() => { ... });

roomsAutoJoined

Triggered once any rooms that have been configured to be automatically joined, specified via the _auto_join_rooms setting, have been entered.

Source:
Examples
_converse.api.listen.on('roomsAutoJoined', () => { ... });
_converse.api.waitUntil('roomsAutoJoined').then(() => { ... });

roster

When the roster has been received from the XMPP server. See also the cachedRoster event further up, which gets called instead of roster if its already in sessionStorage.

Type:
  • Element
Source:
Examples
_converse.api.listen.on('roster', iq => { ... });
_converse.api.waitUntil('roster').then(iq => { ... });

roster

When the roster has been received from the XMPP server. See also the cachedRoster event further up, which gets called instead of roster if its already in sessionStorage.

Type:
  • Element
Source:
Examples
_converse.api.listen.on('roster', iq => { ... });
_converse.api.waitUntil('roster').then(iq => { ... });

rosterContactInitialized

Synchronous event which provides a hook for further initializing a RosterContact

Parameters:
Name Type Description
contact _converse.RosterContact
Source:

rosterContactInitialized

Synchronous event which provides a hook for further initializing a RosterContact

Parameters:
Name Type Description
contact _converse.RosterContact
Source:

rosterPush

When the roster receives a push event from server (i.e. new entry in your contacts roster).

Type:
  • Element
Source:
Example
_converse.api.listen.on('rosterPush', iq => { ... });

rosterPush

When the roster receives a push event from server (i.e. new entry in your contacts roster).

Type:
  • Element
Source:
Example
_converse.api.listen.on('rosterPush', iq => { ... });

rosterReadyAfterReconnection

Similar to rosterInitialized, but instead pertaining to reconnection. This event indicates that the roster and its groups are now again available after Converse.js has reconnected.

Source:
Example
_converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });

rosterReadyAfterReconnection

Similar to rosterInitialized, but instead pertaining to reconnection. This event indicates that the roster and its groups are now again available after Converse.js has reconnected.

Source:
Example
_converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });

rosterViewInitialized

Triggered once the _converse.RosterView instance has been created and initialized.

Source:
Example
_converse.api.listen.on('rosterViewInitialized', () => { ... });

sendMessage

Triggered when a message is being sent out

Type:
  • Object
Parameters:
Name Type Description
data Object
Properties:
Name Type Description
data.chatbox _converse.ChatBox | _converse.ChatRoom
data.message _converse.Message | _converse.ChatRoomMessage
Source:

sendMessage

Triggered when a message is being sent out

Type:
  • Object
Parameters:
Name Type Description
data Object
Properties:
Name Type Description
data.chatbox _converse.ChatBox | _converse.ChatRoom
data.message _converse.Message | _converse.ChatRoomMessage
Source:

serviceDiscovered

Triggered when Converse has learned of a service provided by the XMPP server. See XEP-0030.

Type:
  • Model
Source:
Example
_converse.api.listen.on('featuresDiscovered', feature => { ... });

serviceDiscovered

Triggered when Converse has learned of a service provided by the XMPP server. See XEP-0030.

Type:
  • Model
Source:
Example
_converse.api.listen.on('featuresDiscovered', feature => { ... });

setUserJID

Triggered whenever the user's JID has been updated

Source:

setUserJID

Triggered whenever the user's JID has been updated

Source:

shouldNotifyOfGroupMessage

Hook which allows plugins to run further logic to determine whether a notification should be sent out for this message.

Source:
Example
api.listen.on('shouldNotifyOfGroupMessage', (should_notify) => {
     return should_notify && flurb === floob;
 });

startDiagonalResize

Triggered once the user starts to diagonally resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startDiagonalResize', (view) => { ... });

startHorizontalResize

Triggered once the user starts to horizontally resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startHorizontalResize', (view) => { ... });

startVerticalResize

Triggered once the user starts to vertically resize a _converse.ChatBoxView

Source:
Example
_converse.api.listen.on('startVerticalResize', (view) => { ... });

statusInitialized

Triggered when the user's own chat status has been initialized.

Source:
Examples
_converse.api.listen.on('statusInitialized', status => { ... });
_converse.api.waitUntil('statusInitialized').then(() => { ... });

statusInitialized

Triggered when the user's own chat status has been initialized.

Source:
Examples
_converse.api.listen.on('statusInitialized', status => { ... });
_converse.api.waitUntil('statusInitialized').then(() => { ... });

streamFeaturesAdded

Triggered as soon as the stream features are known. If you want to check whether a stream feature is supported before proceeding, then you'll first want to wait for this event.

Source:
Example
_converse.api.listen.on('streamFeaturesAdded', () => { ... });

streamFeaturesAdded

Triggered as soon as the stream features are known. If you want to check whether a stream feature is supported before proceeding, then you'll first want to wait for this event.

Source:
Example
_converse.api.listen.on('streamFeaturesAdded', () => { ... });

streamResumptionFailed

Triggered when the XEP-0198 stream could not be resumed.

Source:

streamResumptionFailed

Triggered when the XEP-0198 stream could not be resumed.

Source:

userDetailsModalInitialized

Triggered once the UserDetailsModal has been initialized

Type:
Source:
Example
_converse.api.listen.on('userDetailsModalInitialized', (chatbox) => { ... });

userSessionInitialized

Triggered once the user's session has been initialized. The session is a cache which stores information about the user's current session.

Source:

userSessionInitialized

Triggered once the user's session has been initialized. The session is a cache which stores information about the user's current session.

Source:

will-reconnect

Triggered when the connection has dropped, but Converse will attempt to reconnect again.

Source:

will-reconnect

Triggered when the connection has dropped, but Converse will attempt to reconnect again.

Source:

windowStateChanged

Triggered when window state has changed. Used to determine when a user left the page and when came back.

Type:
  • object
Source:
Example
_converse.api.listen.on('windowStateChanged', obj => { ... });

windowStateChanged

Triggered when window state has changed. Used to determine when a user left the page and when came back.

Type:
  • object
Source:
Example
_converse.api.listen.on('windowStateChanged', obj => { ... });