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?).
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
Create a reaction model that provides all the required data for `ReactionDelegate` so that none need to be calculated in QML.
This also cleans up the API for `ReactionDelegate`
Limit the maximum number of avatars shown for other user read markers and collapsed state events
For state events \

For read markers \

This move the finding of links and the creation of a `linkpreviewer` into c++.
- The links are now extracted from the text in `texthandler`
- The `messageeventmodel` now creates and stores `linkpreviewers` for events that have links in the current room.
Two new model roles have been created to let a text delegate know when the link preview should be shown (`showLinkPreview`) and pass the link previewer (`linkPreviewer`). Empty link previewer are returned where link don't exist so the qml doesn't have to have checks for whether the parameters are undefined.
Further improvements to the handling of `mediaInfo` in `messageeventmodel`.
`blurhash` and `thumbnailInfo` are now replaced with a single `tempInfo` object that contains a single temp source. The priority is thumbnail > `blurhash` > empty if none exist.
Fixesnetwork/neochat#235
Create a `messageeventmodel` role for media info and reply media info that is a QMap with all the required data.
This replaces the MediaUrlRole, FileMimeTypeRole and the ContentTypeRole. The reply role no longer needs the content role.
This also ensures mxc urls are now generated for replies. All the media parameters will now have default values assigned in the model so the QML no longer needs to do this.
- Update the message event and user models so that the full source url is output.
- Separate the reply author into its own role
- Create an empty user object that can be passed so that the QML code no longer needs to check if certain parameters exist.
- Make avatarForMember return and empty QUrl if a valid avatar cannot be found and make use in the user and event models
As well as cleaning up the QML this should also stop the QML Image: Media id '' doesn't follow server/mediaId pattern spam in the log.
Update the message role to be named plainText and use it the message delegate for openMessageContext.
This removes the need for plainText in controller so it is removed.
Change location marker to GPS icon, make sure the point is the anchor and colour it with highlight colour
m.self \

m.pin \

When a local message is edited make sure that the initial message that will be merged remains hidden so it doesn't flash up then disappear.
closesnetwork/neochat#314
Rework the filtering of state events in the timeline and for lastevent. This is now consistent everywhere and includes the following:
- The timeline settings are obeyed everywhere
- A new setting is added to filter all state events
- Last event obeys the timeline setting in all cases
- The roomlist will show a state event as the latest event if it's visible in the timeline
- Names are no longer hyperlinked in eventToString if plaintext is selected.
BUG: 455048\
Closesnetwork/neochat#148
Improve the handling of text both when sending and receiving.
The main feature is to fix the linked bug (and a host of others that are unreported but similar) which is caused by the fact that we don't properly clean html. This mr does that as per the matrix spec https://spec.matrix.org/v1.5/client-server-api/#mroommessage-msgtypes. So any disallowed tags or attributes are removed and it does the special handling for certain attributes.
Additionally the functions are also designed to cover any other text formatting required, particularly fro received strings.
The receive side is covered by 2 functions `handleRecieveRichText` and `handleRecievePlainText`. The rich/plain in the function name refers to the output type not the input type (both can take plain and rich input), so `handleRecieveRichText` is called to get a string suitable to go in a rich text control and `handleRecievePlainText` for a plain control.
The functions also handle the following some of which was previously handled by `eventToString` in `NeoChatRoom`:
- Strip and reply from the string
- Format any user mentions
- Linkify links in plain strings
- Handle mxc urls in rich text (uses the new `room->makeMediaUrl` functionality from libQuotient)
- `handleRecievePlainText` also deals with markup making `NeoChatRoom->subtitle` redundant
There is also an extensive test suite which defines the behaviour and the best way to review this is probably to look at the tests and decide whether you agree with the expected output given the inputs and/or if there is any missing behaviour.
The final aim especially with the test suite is to give us a framework to make further updates in the future easier and hopefully prevent a new feature breaking old behaviour with the tests.
BUG: 463932 \
BUG: 466330 \
BUG: 466930
Implement folding sections for multiple consecutive state events. This also reworks some of the aggregated text output:
- Only new days cause a new section
- The aggregated text starts with either a single username or n users
- If the same user did the same action mutltiple times it will be in the aggregated text a user did x n times
- When there are multiple authors in a block with multiple state event types it will use or rather than and before the last event. e.g 3 user left the room or joined the room.
Folded

Unfolded

Implements network/neochat#90