Manage MessageContentModels properly so we don't leak memory.

- 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.
This commit is contained in:
James Graham
2024-07-31 17:57:11 +00:00
parent ea2f891533
commit 37d6033df4
5 changed files with 37 additions and 21 deletions

View File

@@ -1748,6 +1748,7 @@ void NeoChatRoom::downloadEventFromServer(const QString &eventId)
connect(job, &BaseJob::success, this, [this, job, eventId] {
// The event may have arrived in the meantime so check it's not in the timeline.
if (findInTimeline(eventId) != historyEdge()) {
Q_EMIT extraEventLoaded(eventId);
return;
}