Currently the only two ways to spoiler text in your message is either:
* Using the /spoiler command
* Manually typing the data-mx-spoiler span HTML blocks
Neither one is discoverable, or friendly to users really. Instead, we
should extend our existing Markdown-based formatting syntax with one
that can handle spoiler tags. I chose the || syntax to match Discord,
since Element doesn't seem to adopt one.
Unfortunately, CMark does not support custom extensions (see
https://github.com/commonmark/cmark/pull/123) so we have to implement
our own parsing function. New tests are also added for this too.
This doesn't need to be attached to an instance of MessageDelegateBase,
and avoid various problems when called from a MessageObjectIncubator
callback. (Because it needs access to the "this" pointer.)
Fixes a regularly occurring crash when switching rooms.
This should be set *before* we clean up the incubator, because it could
end up accessing invalid data when the incubator is freed. This fixes a
regularly occuring crash when switching rooms.
This is only called after we already get an event with lastEvent() so
doing it again is useless. Instead, we should refactor it to behave like
similar functions (e.g. isEventHighlighted.)
Most of the data in the objects will be empty, but at least a valid matrix id is provided.
This fixes missing data in some places in the UI (e.g., in HiddenDelegate)
Rework MessageDelegate to be mostly a cpp class. This allows us to only load the components that are actually needed saving memory.
In testing using memtest it saved ~30% versus the current implementation.
Force the room list items to update their height when the compactRoomList setting is changed.
The solution is a bit janky but for whatever reason the height wasn't updating properly which seems to be a qml bug, it sometime happened slow, sometime you would have to turn NeoChat off then on again.
BUG: 494146
It seems like the case is possible as we already are treating the case
in isUserBanned. Doesn't seem ideal as it shows "" where the username
should be but it's better than a crash.
I'm 99% sure of the recent crashes we've been seeing are double-frees,
the QCache one me and Duha encountered must be one. The QCache is in
charge of the one in ContentProvider, so it will sometimes try to delete
or access something already destroyed by the QML engine.
While I'm at it, I also made sure to check every other Q_INVOKABLE to
ensure we don't hit this elsewhere.
CCBUG: 502747
In chatBarSizeHelper, if user is in compact mode and resizes the window,
maxWidth would be -1 and that caused something to go wrong with the
padding calculations.
Instead, just set it to root.width with some padding, so it always is
the width of the ChatBar.
For example, "Copy Address to Clipboard" is redundant - almost every
Copy action on your computer does it to the clipboard. The same is done
for the space action too.
If you're a first-time user, the different states on this button may be
a bit confusing. Instead of showing a "plus" sign (meaning an invite) it
will add it to the total notification count. The tooltip text is also
changed to reflect this.