Fixes#1083
Directives are rendered as templates and their bodies are MessageText instances.
We thereby achieve the necessary nesting of directives (and other rich
elements inside directives) by letting each directive
body render itself similarly to how the whole message body is rendered.
Updating tab notifications is not something that should be done in the headless part of Converse.
Don't update the tab title, having a favicon is enough.
In MUCs, messages are fetched too late in order for it to be practical
to wait for messages before rendering various parts of the MUC view.
Previously there was a bug, in the sense that `messages.fetched` was
`undefined` when being `await`ed in `updateAfterMessagesFetched`.
Once this was fixed, this issue became clear.
When we're showing only one chat at a time, we want to make sure that
all other chats have their `hidden` flag set to `true`.
Previously this was done in chatboxviews, but given that we want to
render UI based on state, this should be done in the headless part of
Converse.
As a result of the changes, the `beforeShowingChatView` has been
removed.
* keep message in place after edition by assigning previous message original timestamp
* update time displayed to keep current behaviour
* add test to check a message remains in the same position of the history after being edited
* briefly describe pr changes in changelog
- Add hooks to the stanza parsers so that plugins can do additional parsing.
- Change ChatBox instance methods to functions and use them for stanza parsing.
- Move encrypt and decrypt messages to `converse.env.omemo`
Apparently, when receving a 1:1 carbon message, a device was wrongly created
for the contact's device list, instead of our own.
If a message comes in after joining the MUC but before the MAM messages
have been fetched, then converse-mam will query for MAM messages newer
than that message, causing an empty history (except for that one message).
It's better to parse an incoming message stanza early, than to have
all kinds of methods throughout the codebase that does querySelector
etc.
Firstly, it allows us to catch and report errors and malicious stanzas early on.
It also simplifies programming because you don't need to try and
remember how to properly parse a stanza, all the work is done upfront
for you.