Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #3241

Closed
wants to merge 4 commits into from
Closed

Refactoring #3241

wants to merge 4 commits into from

Conversation

jcbrand
Copy link
Member

@jcbrand jcbrand commented Jul 18, 2023

No description provided.

src/headless/plugins/muc/message.js Fixed Show fixed Hide fixed
src/headless/plugins/muc/muc.js Fixed Show fixed Hide fixed
@jcbrand jcbrand force-pushed the jcbrand/strophe-ts branch 2 times, most recently from 6c0f760 to 5a14bf5 Compare July 20, 2023 08:06
@jcbrand jcbrand force-pushed the jcbrand/strophe-ts branch 5 times, most recently from c31f237 to 2bdea15 Compare August 2, 2023 16:55
Previously the `overrides` functionality of `pluggable.js` was used to
`override` the `model` function on the `ChatBoxes` collection, so that
different types of chatboxes could be created (e.g. MUC, ChatBox, Feed).

This has been replaced with a registry, `api.chatboxes.registry`.

Use `api.chatboxes.registry.add(type, model)` to add a new type of chatbox to
the collection.

Then when `api.chatboxes.create(attrs, options)` is called, the right type of
chatbox will be created if `attrs.type` is the `type` in the registry.
Use the builtin History API and event listeners.
import chat_api from './api.js';
import { Collection } from '@converse/skeletor/src/collection';
import { _converse, api, converse } from '../../index.js';
import { _converse, api, converse, u } from '../../index.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import u.
import ChatRoomOccupant from './occupant.js';
import ChatRoomOccupants from './occupants.js';
import affiliations_api from './affiliations/api.js';
import muc_api from './api.js';
import { Collection } from '@converse/skeletor/src/collection';
import { _converse, api, converse } from '../../index.js';
import { _converse, api, converse, u } from '../../index.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import u.
@@ -35,7 +35,7 @@
return;
}
if (api.settings.get('allow_url_history_change')) {
_converse.router.history.navigate(`#${oldest_message.get('msgid')}`);
history.pushState(null, '', `#${oldest_message.get('msgid')}`)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (92% of all statements in
the enclosing function
have an explicit semicolon).
@jcbrand jcbrand closed this Sep 2, 2023
@jcbrand jcbrand deleted the jcbrand/strophe-ts branch November 3, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant