The eventual goal is to avoid UI-related stanza processing if the relevant chats
aren't in the DOM.
With the current architecture, chatboxes are created (and the stanzas
related to them processed) even if `#conversejs` isn't in the DOM.
* Initial work on making controlbox an element
* Create a shared base class
* Ceate ChatBoxViews proxy
* Update sass now that certain classes are moved to converse-chats element
This element can be used to declaratively insert Converse into the DOM.
You can put `<converse-root>` into the DOM (e.g. by rendering it inside
a React component) before or afer Converse has loaded and/or has been
initialized.
- Move headless one-on-one chat functionality into converse-chat
- Split converse-headline into converse-headlines and converse-headlines-views
- Add api in `_converse.api.chatboxes` for creating chatboxes
- Add `_converse.api.controlbox.get` method
Depend on latest backbone.browserStorage which has support for IndexedDB
via localforage.
Storage operations are now asynchronous and transactional.
Bugs fixed (mostly by waiting for operations to complete):
* Rooms are now fetched asynchronously, so wait before triggering `show`
or when closing.
* Make sure chat create/update transactions complete before firing events
* Make sure chats and messages have been fetched before creating new ones.
* When doing a `fetch` with `wait: false` on a collection and then
creating a model in that collection, then once the read
operation finishes (after creating the model), the collection is emptied again.
* Patch and wait when saving.
Otherwise we have previously set attributes overriding later ones.
* Make sure api.roomviews.close returns a promise
Test fixes:
* Chats are now asynchronously returned, so we need to use `await`
* Wait for the storage transaction to complete when creating and updating messages
* Wait for all chatboxes to close
Otherwise we get sessionStorage inconsistencies due to the async nature of localforage.
* Wait for room views to close in spec/chatroom.js
In the process, remove the `closeAllChatBoxes` override in
converse-controlbox by letting the `close` method decide whether it
should be closed or not.
If we've fetched the roster before within this session, then we don't
have to do so again, regardless of whether versioning is supported or
not, otherwise, even if we have a cached roster, we still need to get
the latest one again.
triggering connectionInitialized.
That way, when listening for `connectionInitialized`, we'll know when it
fires whether we've attached to a BOSH connection or not.
- Remove the `keepalive` configuration setting. It is now always implicitly `true`.
- Remove the `expose_rid_and_sid` configuration setting.
- A `prebind_url` is now mandatory when setting `authentication` to `prebind`.
- It's no longer possible to pass in `rid` and `sid` values to `converse.initialize.
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`
- Refactor logout and login as consistently used api methods
- Refactor session cache to store per JID
Fixes#316
- Let box_id start with char for valid HTML.
- No need to use SHA1 for box id
- No need for the user_id attribute.
- Set nickname when we set the roster contact.
Also...
- _converse.api.contacts.get is now async
- _converse.api.chats.create is now async
- Combine all test init functions into `initConverse`
- Use `async` functions in more tests
- Replace `var` with `let` and `const` in more tests
- New utils method `toStanza` which converts a string to a Node
This reverts commit 7af73c3471.
Doesn't look like the right approach for adding support for XEP-0156.
Work on that will continue in a branch in the meantime.
`toLocaleString` now returns element attributes in alphabetical order
(for better cross-browser consistency).
Also, `toLocaleString` is now used in favor of `outerHTML` because
browsers aren't consistent with one another in their output.