diff --git a/src/headless/plugins/muc/muc.js b/src/headless/plugins/muc/muc.js index c9704d02c..a9ea9551a 100644 --- a/src/headless/plugins/muc/muc.js +++ b/src/headless/plugins/muc/muc.js @@ -1,5 +1,4 @@ import debounce from 'lodash-es/debounce'; -import invoke from 'lodash-es/invoke'; import isElement from 'lodash-es/isElement'; import log from '../../log'; import p from '../../utils/parse-helpers'; @@ -2342,7 +2341,7 @@ const ChatRoomMixin = { // each element pertains to a single user. const item = x.querySelector('item'); const reason = item ? item.querySelector('reason')?.textContent : undefined; - const actor = item ? invoke(item.querySelector('actor'), 'getAttribute', 'nick') : undefined; + const actor = item ? item.querySelector('actor')?.getAttribute('nick') : undefined; const message = _converse.muc.disconnect_messages[codes[0]]; const status = codes.includes('301') ? ROOMSTATUS.BANNED : ROOMSTATUS.DISCONNECTED; this.setDisconnectionState(message, reason, actor, status); diff --git a/src/headless/shared/api/public.js b/src/headless/shared/api/public.js index c2b9dc04b..743c28756 100644 --- a/src/headless/shared/api/public.js +++ b/src/headless/shared/api/public.js @@ -3,7 +3,6 @@ import URI from 'urijs'; import _converse from '../_converse.js'; import dayjs from 'dayjs'; import i18n from '../i18n'; -import invoke from 'lodash-es/invoke'; import log from '../../log.js'; import sizzle from 'sizzle'; import u, { setUnloadEvent } from '../../utils/core.js'; @@ -112,7 +111,7 @@ export const converse = Object.assign(window.converse || {}, { } const plugins = _converse.pluggable.plugins - if (api.settings.get("auto_login") || api.settings.get("keepalive") && invoke(plugins['converse-bosh'], 'enabled')) { + if (api.settings.get("auto_login") || api.settings.get("keepalive") && plugins['converse-bosh']?.enabled()) { await api.user.login(null, null, true); } diff --git a/src/plugins/omemo/utils.js b/src/plugins/omemo/utils.js index ff6f5b7a2..0605758d6 100644 --- a/src/plugins/omemo/utils.js +++ b/src/plugins/omemo/utils.js @@ -608,7 +608,7 @@ async function updateDevicesFromStanza (stanza) { export function registerPEPPushHandler () { // Add a handler for devices pushed from other connected clients _converse.connection.addHandler( - async message => { + async (message) => { try { if (sizzle(`event[xmlns="${Strophe.NS.PUBSUB}#event"]`, message).length) { await api.waitUntil('OMEMOInitialized'); diff --git a/src/shared/chat/utils.js b/src/shared/chat/utils.js index 128edad0d..ec139c164 100644 --- a/src/shared/chat/utils.js +++ b/src/shared/chat/utils.js @@ -1,4 +1,4 @@ -import debounce from 'lodash/debounce'; +import debounce from 'lodash-es/debounce'; import tplNewDay from "./templates/new-day.js"; import { _converse, api, converse } from '@converse/headless/core'; import { html } from 'lit';