Commit 9c6c90a4 authored by JC Brand's avatar JC Brand

Move config settings into the relevant plugins

parent 195a9781
......@@ -711,48 +711,6 @@ Makes sense to set this to ``true`` when also using the non-core
``converse-roomslist`` plugin, which shows a list of currently open (i.e.
"joined") rooms.
include_offline_state
---------------------
* Default: `false`
Originally, converse.js included an `offline` state which the user could
choose (along with `online`, `busy` and `away`).
Eventually it was however decided to remove this state, since the `offline`
state doesn't propagate across tabs like the others do.
What's meant by "propagate across tabs", is that when you set the state to
`offline` in one tab, and you have instances of converse.js open in other tabs
in your browser, then those instances will not have their states changed to
`offline` as well. For the other statees the change is however propagated.
The reason for this is that according to the XMPP spec, there is no `offline`
state. The only defined states are:
* away -- The entity or resource is temporarily away.
* chat -- The entity or resource is actively interested in chattiIng.
* dnd -- The entity or resource is busy (dnd = "Do Not Disturb").
* xa -- The entity or resource is away for an extended period (xa = "eXtended Away").
Read the `relevant section in the XMPP spec <https://xmpp.org/rfcs/rfc6121.html#presence-syntax-children-show>`_
for more info.
What used to happen in converse.js when the `offline` state was chosen, is
that a presence stanza with a `type` of `unavailable` was sent out.
This is actually exactly what happens when you log out of converse.js as well,
with the notable exception that in the `offline` state, the connection is not
terminated. So you can at any time change your state to something else and
start chatting again.
This might be useful to people, however the fact that the `offline` state
doesn't propagate across tabs means that the user experience is inconsistent,
confusing and appears "broken".
If you are however aware of this issue and still want to allow the `offline`
state, then you can set this option to `true` to enable it.
.. _`i18n`:
i18n
......
......@@ -62,7 +62,9 @@
// Refer to docs/source/configuration.rst for explanations of these
// configuration settings.
_converse.api.settings.update({
auto_join_private_chats: [],
'filter_by_resource': false,
'auto_join_private_chats': [],
'forward_messages': false,
});
_converse.api.promises.add([
'chatBoxesFetched',
......
......@@ -101,10 +101,11 @@
{ __ } = _converse;
_converse.api.settings.update({
'use_emojione': false,
'emojione_image_path': emojione.imagePathPNG,
'show_send_button': false,
'show_toolbar': true,
'time_format': 'HH:mm',
'use_emojione': false,
'visible_toolbar_buttons': {
'call': false,
'clear': true,
......
......@@ -293,14 +293,12 @@
// Default configuration values
// ----------------------------
this.default_settings = {
allow_contact_requests: true,
allow_non_roster_messaging: false,
animate: true,
authentication: 'login', // Available values are "login", "prebind", "anonymous" and "external".
auto_away: 0, // Seconds after which user status is set to 'away'
auto_login: false, // Currently only used in connection with anonymous login
auto_reconnect: true,
auto_subscribe: false,
auto_xa: 0, // Seconds after which user status is set to 'xa'
blacklisted_plugins: [],
bosh_service_url: undefined,
......@@ -310,12 +308,8 @@
debug: false,
default_state: 'online',
expose_rid_and_sid: false,
filter_by_resource: false,
forward_messages: false,
geouri_regex: /https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,
geouri_replacement: 'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2',
hide_offline_users: false,
include_offline_state: false,
jid: undefined,
keepalive: true,
locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
......@@ -329,15 +323,11 @@
password: undefined,
prebind_url: null,
priority: 0,
registration_domain: '',
rid: undefined,
root: window.document,
show_only_online_users: false,
show_send_button: false,
sid: undefined,
storage: 'session',
strict_plugin_dependencies: false,
synchronize_availability: true,
trusted: true,
view_mode: 'overlayed', // Choices are 'overlayed', 'fullscreen', 'mobile'
websocket_url: undefined,
......
......@@ -144,9 +144,10 @@
_converse.CONNECTION_STATUS[Strophe.Status.NOTACCEPTABLE] = 'NOTACCEPTABLE';
_converse.api.settings.update({
allow_registration: true,
domain_placeholder: __(" e.g. conversejs.org"), // Placeholder text shown in the domain input on the registration form
providers_link: 'https://xmpp.net/directory.php', // Link to XMPP providers shown on registration page
'allow_registration': true,
'domain_placeholder': __(" e.g. conversejs.org"), // Placeholder text shown in the domain input on the registration form
'providers_link': 'https://xmpp.net/directory.php', // Link to XMPP providers shown on registration page
'registration_domain': ''
});
......
......@@ -22,6 +22,12 @@
const { _converse } = this,
{ __ } = _converse;
_converse.api.settings.update({
'allow_contact_requests': true,
'auto_subscribe': false,
'synchronize_availability': true,
});
_converse.api.promises.add([
'cachedRoster',
'roster',
......
......@@ -80,7 +80,9 @@
_converse.api.settings.update({
'allow_chat_pending_contacts': true,
'allow_contact_removal': true,
'hide_offline_users': false,
'roster_groups': true,
'show_only_online_users': false,
'show_toolbar': true,
'xhr_user_search_url': null
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment