diff --git a/src/headless/plugins/muc/occupants.js b/src/headless/plugins/muc/occupants.js index 97d21b77e..38d4e9052 100644 --- a/src/headless/plugins/muc/occupants.js +++ b/src/headless/plugins/muc/occupants.js @@ -39,16 +39,6 @@ class ChatRoomOccupants extends Collection { return super.create(attrs, options); } - /** - * Get the {@link _converse.ChatRoomOccupant} instance which - * represents the current user. - * @method _converse.ChatRoomOccupants#getOwnOccupant - * @returns { _converse.ChatRoomOccupant } - */ - getOwnOccupant () { - return this.findWhere({ 'jid': _converse.bare_jid }); - } - async fetchMembers () { if (!['member', 'admin', 'owner'].includes(this.getOwnOccupant()?.get('affiliation'))) { // https://xmpp.org/extensions/xep-0045.html#affil-priv @@ -101,10 +91,10 @@ class ChatRoomOccupants extends Collection { * @property { String } [occupant_id] - The XEP-0421 unique occupant id */ /** - * Try to find an existing occupant based on the passed in - * data object. + * Try to find an existing occupant based on the provided + * @link { OccupantData } object. * - * Fetching the user by occupant_id is the quickest, O(1), + * Fetching the user by `occupant_id` is the quickest, O(1), * since it's a dictionary lookup. * * Fetching by jid or nick is O(n), since it requires traversing an array. @@ -123,6 +113,19 @@ class ChatRoomOccupants extends Collection { return jid && this.findWhere({ jid }) || data.nick && this.findWhere({ 'nick': data.nick }); } + + /** + * Get the {@link _converse.ChatRoomOccupant} instance which + * represents the current user. + * @method _converse.ChatRoomOccupants#getOwnOccupant + * @returns { _converse.ChatRoomOccupant } + */ + getOwnOccupant () { + return this.findOccupant({ + 'jid': _converse.bare_jid, + 'occupant_id': this.chatroom.get('occupant_id') + }); + } } diff --git a/src/plugins/controlbox/templates/controlbox.js b/src/plugins/controlbox/templates/controlbox.js index 6e4340a33..9f6a1007d 100644 --- a/src/plugins/controlbox/templates/controlbox.js +++ b/src/plugins/controlbox/templates/controlbox.js @@ -7,8 +7,6 @@ const { Strophe } = converse.env; function whenNotConnected (o) { const connection_status = _converse.connfeedback.get('connection_status'); - console.log("connection_status"); - console.log(connection_status); if ([Strophe.Status.RECONNECTING, Strophe.Status.CONNECTING].includes(connection_status)) { return tpl_spinner(); } diff --git a/src/plugins/omemo/tests/muc.js b/src/plugins/omemo/tests/muc.js index 8fb24487d..65aa687ea 100644 --- a/src/plugins/omemo/tests/muc.js +++ b/src/plugins/omemo/tests/muc.js @@ -87,7 +87,6 @@ describe("The OMEMO module", function() { keyCode: 13 // Enter }); iq_stanza = await u.waitUntil(() => mock.bundleFetched(_converse, contact_jid, '4e30f35051b7b8b42abe083742187228'), 1000); - console.log("Bundle fetched 4e30f35051b7b8b42abe083742187228"); stanza = $iq({ 'from': contact_jid, 'id': iq_stanza.getAttribute('id'), @@ -108,7 +107,6 @@ describe("The OMEMO module", function() { _converse.connection._dataRecv(mock.createRequest(stanza)); iq_stanza = await u.waitUntil(() => mock.bundleFetched(_converse, _converse.bare_jid, '482886413b977930064a5888b92134fe'), 1000); - console.log("Bundle fetched 482886413b977930064a5888b92134fe"); stanza = $iq({ 'from': _converse.bare_jid, 'id': iq_stanza.getAttribute('id'),