This still keeps custom image descriptions, but no longer shows it for
images where it was the same as their filename.
(cherry picked from commit 437c981d30)
If you spam click the "Close link preview" button, it's possible to
crash NeoChat. This is because the index check is wrong for the array
size.
It's possible to even do this due to a bug causing the removal to be
reflected visually too slowly, that's fixed in the next commit.
(cherry picked from commit 253f891c5a)
Turns out trying to manage pointers in the model is a bad idea so only save eventId in MessageContentModel, events pointers will now only be obtained temporarily then discarded to avoid both creating additional copies of the event in the model and potential sources of crashes.
This also creates a basic unit test that we can add to going forward.
{width=148 height=210}
Note: there is still an issue where after starting a new thread the threaded messages only appear after a restart as the root event needs re-downloading from the server to get the thread info added. My plan is to tackle this next.
This will hide the content when a user ignores and re show it if unignored in the same session.
Note: If the client is restarted the rely will be blanked as the server refuses to send the message. However if unignoring a restart is currently required to get the full timeline back. This can't be trivially fixed as it takes a bit of time for the server to deal with the unblock and allow the message to be downloaded. With no signals available to jump off we'd just have to poll the endpoint which considering this is not going to happen often seems like a bad idea for minimal gain.
Closesnetwork/neochat#657
- Clear out unused functions
- All functions are now static
This is because we pretty much always used it in the form:
```
EventHandler eventHandler(room, event);
eventHandler.function();
```
This simplifies it all to a single call.
So at the moment this remains behind the feature flag as this only adds a threadmodel and a basic visualisation. There is much more to come to get it ready for full release.
- Manage MessageContentModels properly so we don't leak memory creating new ones every time the role is refreshed.
- Parent and reply MessageContentModels to their message to make sure they get cleaned up when the parent is deleted.
- Make sure ReactionModels are cleaned up on room change to stop that list just growing.
The intention is that NeochatRoomMember can be created passed to QML and then be fully managed by it. It effectively just grabs the current RoomMember, calls the correct function then discards it so that we don't end up trying to access an already deleted state event.
- move the logic for remembering local filenames from
messagecontentmodel to neochatroom
- use it also when maximized and in context menu opening, to stop
re-downloading
- make onFileTransferCompleted signal connection one-shot (stops memory
leak)
- fix them vanishing after "opening" a file (they get downloaded to
/tmp/ without extension, which caused them to lose preview)
- make all text/plain mimetype files preview
- don't show them in Replies (in consistency with media components)
Make sure that the Author in the content model is only ever updated int he following circumstacnes:
- The member updates their displayname or avatar
- A previously hidden author line is shown
This is done by only doing a full reset on initialisation or when a previously hidden author is shown. The rest of the time we only reset the other content in the message, i.e. everything below the author line.
- NeoChat stores pointer to event
- Event is replaced
- libQuotient deletes the event and notifies us that the event changes
- We're accessing the event to check its id
- Boom
Make this not boom by accessing the ID that we're additionally storing anyway.
Depends on https://github.com/quotient-im/libQuotient/pull/695
Currently basic just to show a working implementation using RoomMember. Currently only the room event and search models are moved over. Will change everything else over once the dependent pr is complete.
- Have LinkPreviewers stored in NeoChatConnection so that they don't have to be reloaded everytime the MessageContentModel is refreshed
- This means the link is never changed (it will be swiched for a new previewer with the new link)
- LinkPreviewers are stored by URL so they can be re-used by any event with the same URL
BUG: 484927 (because the offending code is ripped out)
This adds previews for downloaded pdfs and code files.


Move the itinerary model representation to it's own component and instantiate from MessageComponentModel. This starts to lay some groundwork for previewing other files.
The aim is to be able to use separate delegate for things like codeblocks and quotes so that they can be styled differently.
