insofar we have an `occupant_id`.
We do this by subclassing `create` on the `ChatRoomOccupants` collection
and `save` on the `ChatRoomOccupant` model, to make sure that whenever
an occupant is created or saved, that the `id` matches the `occupant_id`
value if it's available.
This lets us look up the occupant via `occupant_id` via dictionary lookup,
instead of array traversal.
Another change is to save `from_real_jid` when adding an occupant to a message
When there is a circular dependency between disco entities (via their
advertised `disco#items`), Converse went into an infinite loop because
even though there was a check whether an entity already existed, it
failed to add newly created entities to the global
`_converse.disco_entities` collection.
and not in the muc plugin.
This decouples the plugins more. Ideally we can remove the status plugin
entirely from a customized Converse build (but we're not there yet).
Add test case for incoming OMEMO message corrections.
The correction was being ignored because the parsed `msgid` of an
incoming correction was set to the `msgid` of the message being
replaced.
For error messages we still use the `message` attribute, since error
messages generally don't have a body, and if one does, it likely refers
to the `body` of a rejected message that the error refers to.
We're still setting both `body` and `message` attributes, but usage of
`message` for a normal `chat`, `groupchat` or `headline` stanza should
be considered deprecated.
Add the ability to send OMEMO corrections.
Refactor how OMEMO messages are sent to avoid having to override
`sendMessage` and thereby also allowing corrections of OMEMO messages to
be sent out.
Add two new hooks.
- getOutgoingMessageAttributes
- createMessageStanza
to be fetched from the server before triggering OMEMOInitialized.
For some contacts, the IQ to fetch the device list never receives a
response. IQ stanzas take 20 seconds to timeout, which means that all
OMEMO operations are blocked for 20 seconds (because everything waits
for `OMEMOInitialized`).
Create a new API method `api.omemo.devicelists.get` and use that to
fetch and `await` for any devicelist. That way we lazily wait for
devicelists to be fetched from the server and can continue with other
OMEMO operations unrelated to users who's clients don't respond to
devicelist queries.
- Clear timer when a messages changes from epehemeral to non-ephemeral
- Set MUC occupant on `groupchat` message when `type` changes to `groupchat` (from `error`)
- Set roster contact on `chat` message when `type` changes to `chat` (from `error`)
Thanks @afriedmanGlacier
Promises only get recreated upon logout, not reconnection.
However OMEMO was getting re-initialized on reconnection and
`_converse.omemo_store` was also deleted.
This caused a race condition where an incoming MAM message would cause
`parseEncryptedMessage` that then throws an AttributeError because
`_converse.omemo_store` is undefined because OMEMO isn't yet
initialized.
Waiting for the `OMEMOInitialized` promise doesn't help because it's
still the old (already resolved) promise from before the reconnection.