xmpp.chapril.org-conversejs/src/converse.js

76 lines
2.4 KiB
JavaScript
Raw Normal View History

2020-01-26 16:21:20 +01:00
/**
* @description Converse.js (A browser based XMPP chat client)
* @copyright 2020, The Converse developers
* @license Mozilla Public License (MPLv2)
*/
2018-10-23 15:32:08 +02:00
/* START: Removable components
* --------------------
* Any of the following components may be removed if they're not needed.
*/
import "@converse/headless/headless";
import "i18n";
import "converse-registry";
2018-10-23 15:32:08 +02:00
import "converse-autocomplete";
import "converse-bookmark-views"; // Views for XEP-0048 Bookmarks
2018-10-23 15:32:08 +02:00
import "converse-chatview"; // Renders standalone chat boxes for single user chat
import "converse-controlbox"; // The control box
import "converse-dragresize"; // Allows chat boxes to be resized by dragging them
import "converse-fullscreen";
import "converse-mam-views";
2018-10-23 15:32:08 +02:00
import "converse-minimize"; // Allows chat boxes to be minimized
import "converse-muc-views"; // Views related to MUC
import "converse-headlines-view";
2018-10-23 15:32:08 +02:00
import "converse-notification"; // HTML5 Notifications
import "converse-omemo";
import "converse-profile";
import "converse-push"; // XEP-0357 Push Notifications
2018-10-23 15:32:08 +02:00
import "converse-register"; // XEP-0077 In-band registration
import "converse-roomslist"; // Show currently open chat rooms
import "converse-rosterview";
import "converse-singleton";
import "converse-uniview";
import "./components/converse.js";
2018-10-23 15:32:08 +02:00
/* END: Removable components */
import "../sass/converse.scss";
2020-04-23 13:22:31 +02:00
import { converse } from "@converse/headless/converse-core";
const WHITELISTED_PLUGINS = [
'converse-autocomplete',
'converse-bookmark-views',
'converse-chatboxviews',
'converse-chatview',
'converse-controlbox',
'converse-dragresize',
'converse-fullscreen',
'converse-mam-views',
'converse-minimize',
'converse-modal',
'converse-muc-views',
'converse-headlines-view',
'converse-notification',
'converse-omemo',
'converse-profile',
'converse-push',
'converse-register',
'converse-roomslist',
'converse-rosterview',
'converse-singleton',
'converse-uniview'
];
const initialize = converse.initialize;
converse.initialize = function (settings, callback) {
if (Array.isArray(settings.whitelisted_plugins)) {
settings.whitelisted_plugins = settings.whitelisted_plugins.concat(WHITELISTED_PLUGINS);
} else {
settings.whitelisted_plugins = WHITELISTED_PLUGINS;
}
return initialize(settings, callback);
}
2018-10-23 15:32:08 +02:00
export default converse;