Just loading that plugin already triggers an HTTP request, so lets only
do that when really needed and even more importantly, not for every single
location delegate again.
data() being called with an invalid model index seems to happen during
normal operations here, with something in the proxy model chain not
catching that case (due to a row being filtered out presumably?).
This check worked for accounts that already had custom emojis, but if it
never had any added, m_images was never filled and the model would crash
when adding more.
The aim is to put some additional filtering in place to better stop floods of old notifications. This is achieved with a couple of new filters and better tracking of old notifications.
- Make sure to paginate through all notification on initialization to ensure they are all added to old notifications. While we were not previously putting a limit on the number of returned notifications the server can and will do this when there are a very large amount.
- Find the newest timestamp for each connection on initialization and don't post any notifications with an earlier timestamp.
- Track old notifications on a per-connection basis.
Closesnetwork/neochat#358 and network/neochat#423
Create a cpp helper class to calculate the correct delegate width given it's parent width.
This is designed to be more robust and hopefully easier to understand than the current mass of javascript calcs.
BUG: 470167
Still coming from Spectral, where they were taken from Quaternion, where they were dropped because they don't work as expected.
Also, soon to be removed from libQuotient itself.
Always use `NeoChatRoom::getUser` for getting user details in a room context.
- `MessageEventModel` now calls `getUser`
- `getUser` is now overloaded to also be able to take a `NeoChatUser*`
- add params to `getUser` that are needed for the model outputs
Restore the functionality to edit or reply to the last message in the `chatbar`.
This is achieved be moving the functions `getLastLocalUserMessageEventId` and `getLatestMessageFromRow` to `NeoChatRoom` as `editLastMessage` and `replyLastMessage` as `chatbar` no longer has access to `messageEventModel`.
The functions are also simplified as they only need to find the `eventId` and always from row 0 as this was the only use of the functions.
BUG: 469733