Avoid unnecessarily connecting to rooms that should instead receive room
activity indicators (RAI).
- Don't join a newly created room that qualifies for RAI.
- Upon switching back to the tab, don't reconnect to a room that qualifies for RAI.
- Don't ping a room that we didn't actually enter.
- Add a `Stanza` class which can be used by Strophe because it has a
`tree()` function. This is what gets returned by the `stx` tagged
template.
- Throw an error when no valid namespace is on the stanza.
Strophe.Builder used to automatically add the `jabber:client` namespace,
but that doesn't happen with `toStanza`, so we need to fail if it's not
specified by the user.
- Use the Strophe XML Parser
This opens the door to NodeJS support
We now no longer have an `.items` collection on a disco entity.
Instead, add a new API method `api.disco.entities.items` should be used.
This should solve the issue of the entities disappearing when reloading
the page.
Updates #2925
When calling `api.supports(feature, entity_jid)`, it checks whether the entity
supports the feature or whether any of the sub-items on the entity
supports that feature.
However, on `DiscoEntity`, the `waitUntilFeaturesDiscovered` promise
didn't wait for the items on the entity to be fetched, and was therefore
resolved too quickly.
This caused the file upload button to not render.
Updates #2925
Previously we tried to remember whether carbons were enabled before by
saving a flag in the session storage, but apparently this resulted in
false positives and carbons then not being enabled.
With carbons not enabled, clients don't get sent messages.
I don't like the idea of enabling carbons every time the page reloads,
but the alternative is lost messages which is way worse.
I think the issue is that it's not possible to guarantee that the
session is always properly cleared. For example if Converse crashes, and
then the page is reloaded, the session will wrongly indicate that
carbons have been enabled, even though they won't be.
The fix from @joudinet was to call `this.items.create` on `DiscoEntity`,
however we still need to pass in the same `entity` model as before so that both
collections (`this.items` and `_converse.disco_entities`) have a
referene to the same model.
That way, when attributes like `.identities` are added on the entity,
it's available from both `this.items` and `_converse.disco_entities`.