Commit bf4b3efa authored by JC Brand's avatar JC Brand

Import _converse and api

parent 9813d43f
......@@ -5,7 +5,7 @@
* @license Mozilla Public License (MPLv2)
*/
import "@converse/headless/converse-muc";
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import tpl_bookmarks_list from "templates/bookmarks_list.js"
import tpl_muc_bookmark_form from "templates/muc_bookmark_form.js";
import { Model } from 'skeletor.js/src/model.js';
......@@ -35,8 +35,6 @@ converse.plugins.add('converse-bookmark-views', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
// Configuration values for this plugin
// ====================================
......
......@@ -4,13 +4,13 @@
* @license Mozilla Public License (MPLv2)
*/
import "@converse/headless/converse-chatboxes";
import { Overview } from "skeletor.js/src/overview";
import { View } from "skeletor.js/src/view";
import { result } from "lodash";
import { converse } from "@converse/headless/converse-core";
import tpl_avatar from "templates/avatar.svg";
import tpl_background_logo from "templates/background_logo.html";
import tpl_chatboxes from "templates/chatboxes.html";
import { Overview } from "skeletor.js/src/overview";
import { View } from "skeletor.js/src/view";
import { _converse, api, converse } from "@converse/headless/converse-core";
import { result } from "lodash";
const u = converse.env.utils;
......@@ -47,8 +47,6 @@ converse.plugins.add('converse-chatboxviews', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
api.promises.add(['chatBoxViewsInitialized']);
......
......@@ -6,11 +6,6 @@
import "converse-chatboxviews";
import "converse-message-view";
import "converse-modal";
import { BootstrapModal } from "./converse-modal.js";
import { Overview } from "skeletor.js/src/overview";
import { debounce, isString } from "lodash";
import { html, render } from "lit-html";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_chatbox from "templates/chatbox.js";
import tpl_chatbox_head from "templates/chatbox_head.js";
......@@ -24,6 +19,12 @@ import tpl_toolbar from "templates/toolbar.html";
import tpl_toolbar_fileupload from "templates/toolbar_fileupload.html";
import tpl_user_details_modal from "templates/user_details_modal.js";
import xss from "xss/dist/xss";
import { BootstrapModal } from "./converse-modal.js";
import { Overview } from "skeletor.js/src/overview";
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
import { debounce, isString } from "lodash";
import { html, render } from "lit-html";
const { Strophe, sizzle, dayjs } = converse.env;
......@@ -53,10 +54,6 @@ converse.plugins.add('converse-chatview', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
api.settings.update({
'auto_focus': true,
'message_limit': 0,
......
......@@ -4,15 +4,16 @@
* @license Mozilla Public License (MPLv2)
*/
import "converse-chatview";
import { Model } from 'skeletor.js/src/model.js';
import { View } from "skeletor.js/src/view";
import bootstrap from "bootstrap.native";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_brand_heading from "templates/converse_brand_heading.html";
import tpl_controlbox from "templates/controlbox.html";
import tpl_controlbox_toggle from "templates/controlbox_toggle.html";
import tpl_login_panel from "templates/login_panel.js";
import { Model } from 'skeletor.js/src/model.js';
import { View } from "skeletor.js/src/view";
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
const { Strophe, dayjs } = converse.env;
const u = converse.env.utils;
......@@ -98,10 +99,6 @@ converse.plugins.add('converse-controlbox', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
api.settings.update({
allow_logout: true,
default_domain: undefined,
......
......@@ -6,7 +6,7 @@
import "converse-chatview";
import "converse-controlbox";
import { debounce } from "lodash";
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import tpl_dragresize from "templates/dragresize.html";
const u = converse.env.utils;
......@@ -133,9 +133,6 @@ converse.plugins.add('converse-dragresize', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
api.settings.update({
'allow_dragresize': true,
});
......
......@@ -10,7 +10,8 @@ import emoji_picker from "templates/emoji_picker.js";
import sizzle from 'sizzle';
import tpl_emoji_button from "templates/emoji_button.html";
import { View } from "skeletor.js/src/view";
import { converse } from '@converse/headless/converse-core';
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from '@converse/headless/converse-core';
import { debounce, find } from "lodash";
const u = converse.env.utils;
......@@ -68,10 +69,6 @@ converse.plugins.add('converse-emoji-views', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
api.settings.update({
'use_system_emojis': true,
'visible_toolbar_buttons': {
......
......@@ -4,12 +4,12 @@
* @license Mozilla Public License (MPLv2)
*/
import "converse-chatview";
import tpl_chatbox from "templates/chatbox.js";
import tpl_headline_panel from "templates/headline_panel.js";
import { View } from 'skeletor.js/src/view.js';
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
import { render } from "lit-html";
import { converse } from "@converse/headless/converse-core";
import tpl_chatbox from "templates/chatbox.js";
import tpl_headline_panel from "templates/headline_panel.js";
const u = converse.env.utils;
......@@ -47,9 +47,6 @@ converse.plugins.add('converse-headlines-view', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const viewWithHeadlinesPanel = {
renderHeadlinesPanel () {
......
......@@ -6,10 +6,6 @@
import "./utils/html";
import "@converse/headless/converse-emoji";
import URI from "urijs";
import { converse } from "@converse/headless/converse-core";
import { BootstrapModal } from "./converse-modal.js";
import { debounce } from 'lodash'
import { render } from "lit-html";
import filesize from "filesize";
import log from "@converse/headless/log";
import tpl_file_progress from "templates/file_progress.html";
......@@ -18,6 +14,11 @@ import tpl_message from "templates/message.html";
import tpl_message_versions_modal from "templates/message_versions_modal.js";
import tpl_spinner from "templates/spinner.html";
import xss from "xss/dist/xss";
import { BootstrapModal } from "./converse-modal.js";
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
import { debounce } from 'lodash'
import { render } from "lit-html";
const { Strophe, dayjs } = converse.env;
const u = converse.env.utils;
......@@ -31,10 +32,6 @@ converse.plugins.add('converse-message-view', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
function onTagFoundDuringXSSFilter (tag, html, options) {
/* This function gets called by the XSS library whenever it finds
......
......@@ -4,15 +4,15 @@
* @license Mozilla Public License (MPLv2)
*/
import "converse-chatview";
import tpl_chats_panel from "templates/chats_panel.html";
import tpl_toggle_chats from "templates/toggle_chats.html";
import tpl_trimmed_chat from "templates/trimmed_chat.html";
import { Model } from 'skeletor.js/src/model.js';
import { Overview } from "skeletor.js/src/overview";
import { View } from "skeletor.js/src/view";
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
import { debounce, sum } from 'lodash';
import { converse } from "@converse/headless/converse-core";
import tpl_chats_panel from "templates/chats_panel.html";
import tpl_toggle_chats from "templates/toggle_chats.html";
import tpl_trimmed_chat from "templates/trimmed_chat.html";
const { dayjs } = converse.env;
const u = converse.env.utils;
......@@ -113,8 +113,6 @@ converse.plugins.add('converse-minimize', {
/* The initialize function gets called as soon as the plugin is
* loaded by Converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
api.settings.update({'no_trimming': false});
......
......@@ -3,9 +3,10 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import st from "@converse/headless/utils/stanza";
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
const { Strophe, sizzle } = converse.env;
const u = converse.env.utils;
......@@ -19,10 +20,6 @@ converse.plugins.add('converse-notification', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { __ } = _converse;
const { api } = _converse;
_converse.supports_html5_notification = "Notification" in window;
api.settings.update({
......
......@@ -6,12 +6,13 @@
/* global libsignal */
import "converse-profile";
import log from "@converse/headless/log";
import tpl_toolbar_omemo from "templates/toolbar_omemo.html";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
import { concat, debounce, difference, invokeMap, range, omit } from "lodash";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_toolbar_omemo from "templates/toolbar_omemo.html";
const { Strophe, sizzle, $build, $iq, $msg } = converse.env;
const u = converse.env.utils;
......@@ -81,7 +82,6 @@ converse.plugins.add('converse-omemo', {
},
initialize () {
const { _converse } = this.__super__;
this.debouncedRender = debounce(this.render, 50);
this.devicelist = _converse.devicelists.get(_converse.bare_jid);
this.listenTo(this.devicelist.devices, 'change:bundle', this.debouncedRender);
......@@ -93,8 +93,7 @@ converse.plugins.add('converse-omemo', {
},
beforeRender () {
const { _converse } = this.__super__,
device_id = _converse.omemo_store.get('device_id');
const device_id = _converse.omemo_store.get('device_id');
if (device_id) {
this.current_device = this.devicelist.devices.get(device_id);
......@@ -121,8 +120,6 @@ converse.plugins.add('converse-omemo', {
this.devicelist.removeOwnDevices(device_ids)
.then(this.modal.hide)
.catch(err => {
const { _converse } = this.__super__,
{ __ } = _converse;
log.error(err);
_converse.api.alert(
Strophe.LogLevel.ERROR,
......@@ -132,8 +129,6 @@ converse.plugins.add('converse-omemo', {
},
generateOMEMODeviceBundle (ev) {
const { _converse } = this.__super__,
{ __, api } = _converse;
ev.preventDefault();
if (confirm(__(
"Are you sure you want to generate new OMEMO keys? " +
......@@ -150,7 +145,6 @@ converse.plugins.add('converse-omemo', {
},
initialize () {
const { _converse } = this.__super__;
const jid = this.model.get('jid');
this.devicelist = _converse.devicelists.getDeviceList(jid);
this.listenTo(this.devicelist.devices, 'change:bundle', this.render);
......@@ -171,7 +165,6 @@ converse.plugins.add('converse-omemo', {
ChatBox: {
async sendMessage (text, spoiler_hint) {
if (this.get('omemo_active') && text) {
const { _converse } = this.__super__;
const attrs = this.getOutgoingMessageAttributes(text, spoiler_hint);
attrs['is_encrypted'] = true;
attrs['plaintext'] = attrs.message;
......@@ -228,13 +221,8 @@ converse.plugins.add('converse-omemo', {
/* The initialize function gets called as soon as the plugin is
* loaded by Converse.js's plugin machinery.
*/
const { _converse } = this;
const { __ } = _converse;
const { api } = _converse;
api.settings.update({
'omemo_default': false,
});
api.settings.update({'omemo_default': false});
api.promises.add(['OMEMOInitialized']);
......@@ -296,7 +284,6 @@ converse.plugins.add('converse-omemo', {
reportDecryptionError (e) {
if (api.settings.get("loglevel") === 'debug') {
const { __ } = _converse;
this.createMessage({
'message': __("Sorry, could not decrypt a received OMEMO message due to an error.") + ` ${e.name} ${e.message}`,
'type': 'error',
......@@ -590,7 +577,6 @@ converse.plugins.add('converse-omemo', {
}
_converse.createOMEMOMessageStanza = function (chatbox, message, devices) {
const { __ } = _converse;
const body = __("This is an OMEMO encrypted message which your client doesn’t seem to support. "+
"Find more information on https://conversations.im/omemo");
......
......@@ -6,15 +6,16 @@
import "@converse/headless/converse-status";
import "@converse/headless/converse-vcard";
import "converse-modal";
import { BootstrapModal } from "./converse-modal.js";
import UserSettingsModal from "modals/user-settings";
import bootstrap from "bootstrap.native";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import sizzle from 'sizzle';
import tpl_chat_status_modal from "templates/chat_status_modal";
import tpl_profile from "templates/profile.js";
import tpl_profile_modal from "templates/profile_modal";
import { BootstrapModal } from "./converse-modal.js";
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
const u = converse.env.utils;
......@@ -27,9 +28,6 @@ converse.plugins.add('converse-profile', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
api.settings.update({
'allow_adhoc_commands': true,
......
......@@ -6,7 +6,7 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import { filter, reject } from 'lodash';
import log from "@converse/headless/log";
......@@ -21,9 +21,6 @@ converse.plugins.add('converse-push', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
api.settings.update({
'push_app_servers': [],
'enable_muc_push': false
......
......@@ -10,7 +10,7 @@ import "converse-controlbox";
import { __ } from '@converse/headless/i18n';
import { View } from "skeletor.js/src/view";
import { pick } from "lodash";
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_form_input from "templates/form_input.html";
import tpl_form_username from "templates/form_username.html";
......@@ -64,9 +64,6 @@ converse.plugins.add('converse-register', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
_converse.CONNECTION_STATUS[Strophe.Status.REGIFAIL] = 'REGIFAIL';
_converse.CONNECTION_STATUS[Strophe.Status.REGISTERED] = 'REGISTERED';
_converse.CONNECTION_STATUS[Strophe.Status.CONFLICT] = 'CONFLICT';
......
......@@ -8,7 +8,7 @@
*/
import "@converse/headless/converse-muc";
import RoomDetailsModal from 'modals/muc-details.js';
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import tpl_rooms_list from "templates/rooms_list.js";
import { Model } from 'skeletor.js/src/model.js';
import { View } from 'skeletor.js/src/view.js';
......@@ -39,8 +39,6 @@ converse.plugins.add('converse-roomslist', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
// Promises exposed by this plugin
api.promises.add('roomsListInitialized');
......
......@@ -6,12 +6,6 @@
import "@converse/headless/converse-chatboxes";
import "@converse/headless/converse-roster";
import "converse-modal";
import { compact, debounce, has, isString, uniq, without } from "lodash";
import { BootstrapModal } from "./converse-modal.js";
import { View } from 'skeletor.js/src/view.js';
import { Model } from 'skeletor.js/src/model.js';
import { OrderedListView } from "skeletor.js/src/overview";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_add_contact_modal from "templates/add_contact_modal.js";
import tpl_group_header from "templates/group_header.html";
......@@ -20,6 +14,13 @@ import tpl_requesting_contact from "templates/requesting_contact.html";
import tpl_roster from "templates/roster.html";
import tpl_roster_filter from "templates/roster_filter.js";
import tpl_roster_item from "templates/roster_item.html";
import { BootstrapModal } from "./converse-modal.js";
import { Model } from 'skeletor.js/src/model.js';
import { OrderedListView } from "skeletor.js/src/overview";
import { View } from 'skeletor.js/src/view.js';
import { __ } from '@converse/headless/i18n';
import { _converse, api, converse } from "@converse/headless/converse-core";
import { compact, debounce, has, isString, uniq, without } from "lodash";
const { Strophe } = converse.env;
const u = converse.env.utils;
......@@ -33,9 +34,6 @@ converse.plugins.add('converse-rosterview', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
api.settings.update({
'autocomplete_add_contact': true,
......
......@@ -6,10 +6,10 @@
* @license Mozilla Public License (MPLv2)
*/
import "@converse/headless/converse-muc";
import { converse } from "@converse/headless/converse-core";
import log from "./log";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import log from "./log";
import { _converse, api, converse } from "@converse/headless/converse-core";
const { Strophe, $iq, sizzle } = converse.env;
const u = converse.env.utils;
......@@ -60,8 +60,6 @@ converse.plugins.add('converse-bookmarks', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
// Configuration values for this plugin
......
......@@ -6,7 +6,7 @@
*/
import 'strophe.js/src/bosh';
import { Model } from 'skeletor.js/src/model.js';
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
import log from "./log";
const { Strophe } = converse.env;
......@@ -21,9 +21,6 @@ converse.plugins.add('converse-bosh', {
},
initialize () {
const { _converse } = this;
const { api } = _converse;
api.settings.update({
bosh_service_url: undefined,
prebind_url: null
......
......@@ -3,13 +3,13 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import { find, isMatch, isObject, isString, pick } from "lodash";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { converse } from "./converse-core";
import filesize from "filesize";
import log from "./log";
import st from "./utils/stanza";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { _converse, api, converse } from "./converse-core";
import { find, isMatch, isObject, isString, pick } from "lodash";
const { $msg, Strophe, sizzle, utils } = converse.env;
const u = converse.env.utils;
......@@ -34,8 +34,6 @@ converse.plugins.add('converse-chat', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
// Configuration values for this plugin
......
......@@ -5,7 +5,7 @@
*/
import "./converse-emoji";
import { Collection } from "skeletor.js/src/collection";
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
import { isString } from "lodash";
import log from "./log";
......@@ -25,8 +25,6 @@ converse.plugins.add('converse-chatboxes', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
api.promises.add([
'chatBoxesFetched',
......
......@@ -4,12 +4,12 @@
* @license Mozilla Public License (MPLv2)
* @description Converse plugin which add support for XEP-0030: Service Discovery
*/
import { isEmpty, isObject } from "lodash";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { converse } from "./converse-core";
import log from "./log";
import sizzle from "sizzle";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { _converse, api, converse } from "./converse-core";
import { isEmpty, isObject } from "lodash";
const { Strophe, $iq, utils } = converse.env;
......@@ -19,8 +19,6 @@ converse.plugins.add('converse-disco', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
// Promises exposed by this plugin
api.promises.add('discoInitialized');
......
......@@ -6,7 +6,7 @@
import { Model } from 'skeletor.js/src/model.js';
import { find, uniq } from "lodash";
import * as twemoji from "twemoji";
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
const u = converse.env.utils;
......@@ -60,8 +60,6 @@ converse.plugins.add('converse-emoji', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { ___ } = _converse;
api.settings.update({
......
......@@ -4,7 +4,7 @@
* @description XEP-0045 Multi-User Chat Views
*/
import { isString } from "lodash";
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import st from "./utils/stanza";
......@@ -45,8 +45,6 @@ converse.plugins.add('converse-headlines', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
/**
* Shows headline messages
......
......@@ -6,14 +6,12 @@
*/
import "./converse-disco";
import "./converse-rsm";
import { api } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import { intersection, pick } from 'lodash'
import { converse } from "./converse-core";
import log from "./log";
import sizzle from "sizzle";
import st from "./utils/stanza";
let _converse;
const { Strophe, $iq, dayjs } = converse.env;
const { NS } = Strophe;
const u = converse.env.utils;
......@@ -133,8 +131,6 @@ converse.plugins.add('converse-mam', {
/* The initialize function gets called as soon as the plugin is
* loaded by Converse.js's plugin machinery.
*/
_converse = this._converse;
api.settings.update({
archived_messages_page_size: '50',
message_archiving: undefined, // Supported values are 'always', 'never', 'roster' (https://xmpp.org/extensions/xep-0313.html#prefs)
......
......@@ -10,7 +10,7 @@ import "./converse-emoji";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { clone, debounce, intersection, invoke, isElement, isObject, isString, pick, uniq, zipObject } from "lodash";
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
import log from "./log";
import muc_utils from "./utils/muc";
import st from "./utils/stanza";
......@@ -108,8 +108,6 @@ converse.plugins.add('converse-muc', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __, ___ } = _converse;
// Configuration values for this plugin
......
......@@ -6,7 +6,7 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
import log from "./log";
const { Strophe, $iq } = converse.env;
......@@ -21,9 +21,6 @@ converse.plugins.add('converse-ping', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
let lastStanzaDate;
api.settings.update({
......
......@@ -4,7 +4,7 @@
* @license Mozilla Public License (MPLv2)
*/
import "./converse-disco";
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
import log from "./log";
const { Strophe, $iq } = converse.env;
......@@ -17,12 +17,6 @@ converse.plugins.add('converse-pubsub', {
dependencies: ["converse-disco"],
initialize () {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
/************************ BEGIN API ************************/
// We extend the default converse.js API to add methods specific to MUC groupchats.
......
......@@ -7,7 +7,7 @@ import "@converse/headless/converse-status";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { invoke, isEmpty, isNaN, isString, propertyOf, sum } from "lodash";
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
import log from "./log";
const { Strophe, $iq, $pres, dayjs, sizzle } = converse.env;
......@@ -22,8 +22,6 @@ converse.plugins.add('converse-roster', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
const { __ } = _converse;
api.settings.update({
......
......@@ -4,7 +4,7 @@
* @license Mozilla Public License (MPLv2)
* @description Converse.js plugin which adds support for XEP-0198: Stream Management
*/
import { converse } from "./converse-core";
import { _converse, api, converse } from "./converse-core";
import log from "./log";
const { Strophe } = converse.env;
......@@ -17,8 +17,6 @@ Strophe.addNamespace('SM', 'urn:xmpp:sm:3');
converse.plugins.add('converse-smacks', {
initialize () {
const { _converse } = this;
const { api } = _converse;
// Configuration values for this plugin
// ====================================
......
......@@ -5,7 +5,7 @@
*/
import { isNaN, isObject, isString } from "lodash";
import { Model } from 'skeletor.js/src/model.js';
import { converse } from "@converse/headless/converse-core";
import { _converse, api, converse } from "@converse/headless/converse-core";
const { Strophe, $build, $pres } = converse.env;
......@@ -13,8 +13,6 @@ const { Strophe, $build, $pres } = converse.env;
converse.plugins.add('converse-status', {
initialize () {
const { _converse } = this;
const { api } = _converse;
api.settings.update({
auto_away: 0, // Seconds after which user status is set to 'away'
......
......@@ -4,12 +4,12 @@
* @license Mozilla Public License (MPLv2)
*/
import "./converse-status";
import log from "@converse/headless/log";
import tpl_vcard from "./templates/vcard.html";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { _converse, api, converse } from "./converse-core";
import { has, isString } from "lodash";
import { converse } from "./converse-core";
import log from "@converse/headless/log";
import tpl_vcard from "./templates/vcard.html";
const { Strophe, $iq, dayjs } = converse.env;
const u = converse.env.utils;
......@@ -64,9 +64,6 @@ converse.plugins.add('converse-vcard', {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
const { api } = _converse;
api.promises.add('VCardsInitialized');
......
import { BootstrapModal } from "../converse-modal.js";
import { __ } from '@converse/headless/i18n';
import { api } from "@converse/headless/converse-core";
import { api, converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import sizzle from "sizzle";
import tpl_muc_commands_modal from "../templates/muc_commands_modal.js";
const { Strophe, $iq } = window.converse.env;
const u = window.converse.env.utils;
const { Strophe, $iq } = converse.env;
const u = converse.env.utils;
export default BootstrapModal.extend({
......
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