|
@@ -1,41 +1,46 @@
|
|
|
/**
|
|
|
- * @copyright 2022, the Converse.js contributors
|
|
|
+ * @copyright 2025, the Converse.js contributors
|
|
|
* @license Mozilla Public License (MPLv2)
|
|
|
*/
|
|
|
-import { _converse, api, converse, RosterFilter } from "@converse/headless";
|
|
|
+import { _converse, api, converse, RosterFilter } from '@converse/headless';
|
|
|
import RosterContactView from './contactview.js';
|
|
|
import { highlightRosterItem } from './utils.js';
|
|
|
-import "../modal";
|
|
|
-import "./modals/add-contact.js";
|
|
|
-import "./modals/accept-contact-request.js";
|
|
|
-import "./modals/new-chat.js";
|
|
|
-import './rosterview.js';
|
|
|
+import '../modal';
|
|
|
+import AddContactModal from './modals/add-contact.js';
|
|
|
+import AcceptContactRequestModal from './modals/accept-contact-request.js';
|
|
|
+import NewChatModal from './modals/new-chat.js';
|
|
|
+import RosterView from './rosterview.js';
|
|
|
|
|
|
import 'shared/styles/status.scss';
|
|
|
import './styles/roster.scss';
|
|
|
|
|
|
-
|
|
|
converse.plugins.add('converse-rosterview', {
|
|
|
+ dependencies: ['converse-roster', 'converse-modal', 'converse-chatboxviews', 'converse-blocklist'],
|
|
|
|
|
|
- dependencies: ["converse-roster", "converse-modal", "converse-chatboxviews", "converse-blocklist"],
|
|
|
-
|
|
|
- initialize () {
|
|
|
+ initialize() {
|
|
|
api.settings.extend({
|
|
|
- 'allow_contact_removal': true,
|
|
|
- 'hide_offline_users': false,
|
|
|
- 'roster_groups': true,
|
|
|
- 'xhr_user_search_url': null,
|
|
|
+ allow_contact_removal: true,
|
|
|
+ hide_offline_users: false,
|
|
|
+ roster_groups: true,
|
|
|
+ xhr_user_search_url: null,
|
|
|
});
|
|
|
api.promises.add('rosterViewInitialized');
|
|
|
|
|
|
- const exports = { RosterFilter, RosterContactView };
|
|
|
+ const exports = {
|
|
|
+ RosterFilter,
|
|
|
+ RosterView,
|
|
|
+ RosterContactView,
|
|
|
+ AddContactModal,
|
|
|
+ AcceptContactRequestModal,
|
|
|
+ NewChatModal,
|
|
|
+ };
|
|
|
Object.assign(_converse, exports); // DEPRECATED
|
|
|
Object.assign(_converse.exports, exports);
|
|
|
|
|
|
/* -------- Event Handlers ----------- */
|
|
|
api.listen.on('chatBoxesInitialized', () => {
|
|
|
- _converse.state.chatboxes.on('destroy', c => highlightRosterItem(c.get('jid')));
|
|
|
- _converse.state.chatboxes.on('change:hidden', c => highlightRosterItem(c.get('jid')));
|
|
|
+ _converse.state.chatboxes.on('destroy', (c) => highlightRosterItem(c.get('jid')));
|
|
|
+ _converse.state.chatboxes.on('change:hidden', (c) => highlightRosterItem(c.get('jid')));
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
});
|