2024-05-23 09:42:14 +00:00
|
|
|
// SPDX-FileCopyrightText: 2013-2018 JC Brand <https://github.com/conversejs/converse.js/>
|
|
|
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-04-29 14:46:21 +00:00
|
|
|
/**
|
|
|
|
* @description This files will override the original ConverseJS index.js file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import './i18n/index.js'
|
|
|
|
import 'shared/registry.js'
|
|
|
|
import { CustomElement } from 'shared/components/element'
|
|
|
|
import { VIEW_PLUGINS } from './shared/constants.js'
|
2024-07-11 15:53:50 +00:00
|
|
|
import { _converse, converse } from '@converse/headless'
|
2024-04-29 14:46:21 +00:00
|
|
|
|
|
|
|
import 'shared/styles/index.scss'
|
|
|
|
|
|
|
|
/* START: Removable plugins
|
|
|
|
* ------------------------
|
|
|
|
* Any of the following plugin imports may be removed if the plugin is not needed
|
|
|
|
*
|
|
|
|
* Comments line were removed for the peertube-plugin-livechat.
|
|
|
|
*/
|
|
|
|
import './plugins/modal/index.js'
|
|
|
|
import './plugins/adhoc-views/index.js' // Views for XEP-0050 Ad-Hoc commands
|
|
|
|
import './plugins/bookmark-views/index.js' // Views for XEP-0048 Bookmarks
|
|
|
|
import './plugins/chatview/index.js' // Renders standalone chat boxes for single user chat
|
|
|
|
import './plugins/controlbox/index.js' // The control box
|
|
|
|
import './plugins/headlines-view/index.js'
|
|
|
|
import './plugins/mam-views/index.js'
|
|
|
|
import './plugins/muc-views/index.js' // Views related to MUC
|
|
|
|
// import './plugins/minimize/index.js' // Allows chat boxes to be minimized
|
|
|
|
// import './plugins/notifications/index.js'
|
|
|
|
// import './plugins/profile/index.js'
|
|
|
|
// import './plugins/omemo/index.js'
|
|
|
|
// import './plugins/push/index.js' // XEP-0357 Push Notifications
|
|
|
|
import './plugins/register/index.js' // XEP-0077 In-band registration
|
|
|
|
// import './plugins/roomslist/index.js' // Show currently open chat rooms
|
|
|
|
import './plugins/rootview/index.js'
|
|
|
|
import './plugins/rosterview/index.js'
|
|
|
|
import './plugins/singleton/index.js'
|
|
|
|
// import './plugins/dragresize/index.js' // Allows chat boxes to be resized by dragging them
|
|
|
|
import './plugins/fullscreen/index.js'
|
|
|
|
|
2024-05-12 11:10:35 +00:00
|
|
|
import '../custom/plugins/size/index.js'
|
2024-07-29 16:58:02 +00:00
|
|
|
import '../custom/plugins/notes/index.js'
|
2024-04-29 14:46:21 +00:00
|
|
|
import '../custom/plugins/tasks/index.js'
|
2024-06-25 07:59:46 +00:00
|
|
|
import '../custom/plugins/terms/index.js'
|
2024-06-27 17:56:12 +00:00
|
|
|
import '../custom/plugins/poll/index.js'
|
2024-04-29 14:46:21 +00:00
|
|
|
/* END: Removable components */
|
|
|
|
|
2024-07-15 14:27:01 +00:00
|
|
|
// Running some specific livechat patches:
|
|
|
|
import '../custom/livechat-patch-vcard.js'
|
|
|
|
|
2024-04-29 14:46:21 +00:00
|
|
|
import { CORE_PLUGINS } from './headless/shared/constants.js'
|
2024-06-20 14:46:14 +00:00
|
|
|
import { ROOM_FEATURES } from './headless/plugins/muc/constants.js'
|
|
|
|
// We must add our custom plugins to CORE_PLUGINS (so it is white listed):
|
2024-05-12 11:10:35 +00:00
|
|
|
CORE_PLUGINS.push('livechat-converse-size')
|
2024-04-29 14:46:21 +00:00
|
|
|
CORE_PLUGINS.push('livechat-converse-tasks')
|
2024-06-25 07:59:46 +00:00
|
|
|
CORE_PLUGINS.push('livechat-converse-terms')
|
2024-06-27 17:56:12 +00:00
|
|
|
CORE_PLUGINS.push('livechat-converse-poll')
|
2024-07-29 16:58:02 +00:00
|
|
|
CORE_PLUGINS.push('livechat-converse-notes')
|
2024-06-20 14:46:14 +00:00
|
|
|
// We must also add our custom ROOM_FEATURES, so that they correctly resets
|
|
|
|
// (see headless/plugins/muc, getDiscoInfoFeatures, which loops on this const)
|
|
|
|
ROOM_FEATURES.push('x_peertubelivechat_mute_anonymous')
|
2024-04-29 14:46:21 +00:00
|
|
|
|
2024-07-15 12:20:44 +00:00
|
|
|
_converse.exports.CustomElement = CustomElement
|
2024-04-29 14:46:21 +00:00
|
|
|
|
|
|
|
const initialize = converse.initialize
|
|
|
|
|
|
|
|
converse.initialize = function (settings, callback) {
|
|
|
|
if (Array.isArray(settings.whitelisted_plugins)) {
|
|
|
|
settings.whitelisted_plugins = settings.whitelisted_plugins.concat(VIEW_PLUGINS)
|
|
|
|
} else {
|
|
|
|
settings.whitelisted_plugins = VIEW_PLUGINS
|
|
|
|
}
|
|
|
|
return initialize(settings, callback)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default converse
|