Commit 20098c08 authored by JC Brand's avatar JC Brand

Restrict whitelist for headless only to the relevant plugins

parent 0a02b62c
...@@ -69328,6 +69328,19 @@ __webpack_require__.r(__webpack_exports__); ...@@ -69328,6 +69328,19 @@ __webpack_require__.r(__webpack_exports__);
/* END: Removable components */ /* END: Removable components */
const WHITELISTED_PLUGINS = ['converse-autocomplete', 'converse-bookmarks', 'converse-caps', 'converse-chatboxviews', 'converse-chatview', 'converse-controlbox', 'converse-dragresize', 'converse-embedded', 'converse-fullscreen', 'converse-headline', 'converse-message-view', 'converse-minimize', 'converse-modal', 'converse-muc-views', 'converse-notification', 'converse-oauth', 'converse-omemo', 'converse-profile', 'converse-push', 'converse-register', 'converse-roomslist', 'converse-rosterview', 'converse-singleton'];
const initialize = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"].initialize;
_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"].initialize = function (settings, callback) {
if (_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"].env._.isArray(settings.whitelisted_plugins)) {
settings.whitelisted_plugins = settings.whitelisted_plugins.concat(WHITELISTED_PLUGINS);
} else {
settings.whitelisted_plugins = WHITELISTED_PLUGINS;
}
return initialize(settings, callback);
};
/* harmony default export */ __webpack_exports__["default"] = (_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"]); /* harmony default export */ __webpack_exports__["default"] = (_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"]);
/***/ }), /***/ }),
...@@ -71624,7 +71637,7 @@ const _converse = { ...@@ -71624,7 +71637,7 @@ const _converse = {
_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.extend(_converse, _backbone_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.Events); // Core plugins are whitelisted automatically _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.extend(_converse, _backbone_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.Events); // Core plugins are whitelisted automatically
_converse.core_plugins = ['converse-autocomplete', 'converse-bookmarks', 'converse-caps', 'converse-chatboxes', 'converse-chatboxviews', 'converse-chatview', 'converse-controlbox', 'converse-core', 'converse-disco', 'converse-dragresize', 'converse-embedded', 'converse-fullscreen', 'converse-headline', 'converse-mam', 'converse-message-view', 'converse-minimize', 'converse-modal', 'converse-muc', 'converse-muc-views', 'converse-notification', 'converse-omemo', 'converse-ping', 'converse-profile', 'converse-push', 'converse-register', 'converse-roomslist', 'converse-roster', 'converse-rosterview', 'converse-singleton', 'converse-spoilers', 'converse-vcard']; // Setting wait to 59 instead of 60 to avoid timing conflicts with the _converse.core_plugins = ['converse-chatboxes', 'converse-core', 'converse-disco', 'converse-mam', 'converse-muc', 'converse-ping', 'converse-roster', 'converse-vcard']; // Setting wait to 59 instead of 60 to avoid timing conflicts with the
// webserver, which is often also set to 60 and might therefore sometimes // webserver, which is often also set to 60 and might therefore sometimes
// return a 504 error page instead of passing through to the BOSH proxy. // return a 504 error page instead of passing through to the BOSH proxy.
...@@ -25,4 +25,42 @@ import "@converse/headless/converse-vcard"; // XEP-0054 VCard-temp ...@@ -25,4 +25,42 @@ import "@converse/headless/converse-vcard"; // XEP-0054 VCard-temp
/* END: Removable components */ /* END: Removable components */
import converse from "@converse/headless/converse-core"; import converse from "@converse/headless/converse-core";
const WHITELISTED_PLUGINS = [
'converse-autocomplete',
'converse-bookmarks',
'converse-caps',
'converse-chatboxviews',
'converse-chatview',
'converse-controlbox',
'converse-dragresize',
'converse-embedded',
'converse-fullscreen',
'converse-headline',
'converse-message-view',
'converse-minimize',
'converse-modal',
'converse-muc-views',
'converse-notification',
'converse-oauth',
'converse-omemo',
'converse-profile',
'converse-push',
'converse-register',
'converse-roomslist',
'converse-rosterview',
'converse-singleton'
];
const initialize = converse.initialize;
converse.initialize = function (settings, callback) {
if (converse.env._.isArray(settings.whitelisted_plugins)) {
settings.whitelisted_plugins = settings.whitelisted_plugins.concat(WHITELISTED_PLUGINS);
} else {
settings.whitelisted_plugins = WHITELISTED_PLUGINS;
}
return initialize(settings, callback);
}
export default converse; export default converse;
...@@ -71,36 +71,13 @@ _.extend(_converse, Backbone.Events); ...@@ -71,36 +71,13 @@ _.extend(_converse, Backbone.Events);
// Core plugins are whitelisted automatically // Core plugins are whitelisted automatically
_converse.core_plugins = [ _converse.core_plugins = [
'converse-autocomplete',
'converse-bookmarks',
'converse-caps',
'converse-chatboxes', 'converse-chatboxes',
'converse-chatboxviews',
'converse-chatview',
'converse-controlbox',
'converse-core', 'converse-core',
'converse-disco', 'converse-disco',
'converse-dragresize',
'converse-embedded',
'converse-fullscreen',
'converse-headline',
'converse-mam', 'converse-mam',
'converse-message-view',
'converse-minimize',
'converse-modal',
'converse-muc', 'converse-muc',
'converse-muc-views',
'converse-notification',
'converse-omemo',
'converse-ping', 'converse-ping',
'converse-profile',
'converse-push',
'converse-register',
'converse-roomslist',
'converse-roster', 'converse-roster',
'converse-rosterview',
'converse-singleton',
'converse-spoilers',
'converse-vcard' 'converse-vcard'
]; ];
......
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