diff --git a/src/converse-controlbox.js b/src/converse-controlbox.js index 66abbfa55..4b93a5b0e 100644 --- a/src/converse-controlbox.js +++ b/src/converse-controlbox.js @@ -10,6 +10,7 @@ define("converse-controlbox", [ "converse-core", "converse-api", + "converse-rosterview", // TODO: remove this dependency "converse-chatview" ], factory); @@ -172,12 +173,9 @@ * loaded by converse.js's plugin machinery. */ var converse = this.converse; - var settings = { + this.updateSettings({ show_controlbox_by_default: false, - }; - _.extend(converse.default_settings, settings); - _.extend(converse, settings); - _.extend(converse, _.pick(converse.user_settings, Object.keys(settings))); + }); var STATUSES = { 'dnd': __('This contact is busy'), diff --git a/src/converse-notification.js b/src/converse-notification.js index 5e6bccfa3..6907f64dd 100644 --- a/src/converse-notification.js +++ b/src/converse-notification.js @@ -28,16 +28,14 @@ * loaded by converse.js's plugin machinery. */ var converse = this.converse; - // Configuration values for this plugin - var settings = { + + this.updateSettings({ show_desktop_notifications: true, play_sounds: false, sounds_path: '/sounds/', notification_icon: '/logo/conversejs.png' - }; - _.extend(converse.default_settings, settings); - _.extend(converse, settings); - _.extend(converse, _.pick(converse.user_settings, Object.keys(settings))); + }); + converse.isOnlyChatStateNotification = function ($msg) { // See XEP-0085 Chat State Notification diff --git a/src/converse-ping.js b/src/converse-ping.js index e67c1f017..2fcbc7d72 100644 --- a/src/converse-ping.js +++ b/src/converse-ping.js @@ -46,13 +46,10 @@ * loaded by converse.js's plugin machinery. */ var converse = this.converse; - // Configuration values for this plugin - var settings = { + + this.updateSettings({ ping_interval: 180 //in seconds - }; - _.extend(converse.default_settings, settings); - _.extend(converse, settings); - _.extend(converse, _.pick(converse.user_settings, Object.keys(settings))); + }); converse.ping = function (jid, success, error, timeout) { // XXX: We could first check here if the server advertised that diff --git a/src/converse-register.js b/src/converse-register.js index eabd31edd..4da1e545a 100644 --- a/src/converse-register.js +++ b/src/converse-register.js @@ -80,16 +80,12 @@ * loaded by converse.js's plugin machinery. */ var converse = this.converse; - // For translations - // Configuration values for this plugin - var settings = { + + this.updateSettings({ 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 - }; - _.extend(converse.default_settings, settings); - _.extend(converse, settings); - _.extend(converse, _.pick(converse.user_settings, Object.keys(settings))); + }); converse.RegisterPanel = Backbone.View.extend({