When calling `getDeviceList`, wait for the devices to be fetched
Otherwise a race condition might occur, whereby a new device gets
created in the collection, and then removed again as the collection is
replaced with the values fetched from the browser-storage cache.
Also created `converse-omemo-fingerprints` component to asynchronously
render fingerprints in the user details modal. Was done as part of this
commit because due to `getDeviceList` being async, the relevant test for
the modal were also failing
before parsing message stanza for encryption parameters.
Otherwise we might not know what our own device-id/sid is, and therefore
can't decrypt the incoming message.
Fixes#2733
As mentioned in the XEP, don't show error messages for OMEMO messages
that can't be decrypted because they were already decrypted before or
because they weren't encrypted for this device.
And use that to render images in unfurls.
This solves the issue of github URL unfurl images not having an image
extension and then being rendered as a hyperlink by `converse-rich-text`.
Instead, we know that it's supposed to be a url, so we just use `converse-image`.
This let's us populate the `from_real_jid` attribute for messages in
cases where the user's nickname has changed.
Only save the occupant-id if the MUC supports it
Store all advertised features on the `chatbox.features` model.
This allows us to look up a feature without using the async
`disco.supports` API.
Updates #2241
- Unregister nickname before sending unavailable presence
- Send unavailable presence before destroying state
- Call `leave` after unregistering, otherwise the disco entry for the MUC gets removed in `leave` while it's still necessary to unregister
- Wrap `this.leave` in try/except in `onConnectionStatusChanged` handler
- Add new MUC connection status, `CLOSING` to avoid `this.leave()` being called when `hidden` gets set to `true` while the MUC is in the process of being closed.
I noticed that a marker was sent for an error message (created due to an
unencryptable OMEMO messages), and this caused the user to be kicked
from the MUC.