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.
This specific TapHandler proves to be a bit trigger-happy; when trying to copy
text, select or de-select text, or generally do more than stare at it without
touching your mouse, it is too easy to minimize the fullscreen component. This
fixes the issue entirely; when tapping on the message in the timeline, it
still shows a maximized message. This only applies to the maximized message.