Converse converse.js

Namespace: settings

_converse.api.settings

This grouping allows access to the configuration settings of Converse.

Source:

Methods

(static) get() → {*}

Source:
Returns:

Value of the particular configuration setting.

Type
*
Example
_converse.api.settings.get("play_sounds");

(static) set(settingsopt, keyopt, valueopt)

Set one or many configuration settings.

Note, this is not an alternative to calling converse.initialize, which still needs to be called. Generally, you'd use this method after Converse is already running and you want to change the configuration on-the-fly.

Parameters:
Name Type Attributes Description
settings Object <optional>

An object containing configuration settings.

key string <optional>

Alternatively to passing in an object, you can pass in a key and a value.

value string <optional>
Source:
Examples
_converse.api.settings.set("play_sounds", true);
_converse.api.settings.set({
    "play_sounds", true,
    "hide_offline_users" true
});

(static) update(settings)

Allows new configuration settings to be specified, or new default values for existing configuration settings to be specified.

Parameters:
Name Type Description
settings object

The configuration settings

Source:
Example
_converse.api.settings.update({
   'enable_foo': true
});

// The user can then override the default value of the configuration setting when
// calling `converse.initialize`.
converse.initialize({
    'enable_foo': false
});