Only save eventId in MessageContentModel
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.
This commit is contained in:
@@ -1768,6 +1768,9 @@ QByteArray NeoChatRoom::roomAcountDataJson(const QString &eventType)
|
||||
void NeoChatRoom::downloadEventFromServer(const QString &eventId)
|
||||
{
|
||||
if (findInTimeline(eventId) != historyEdge()) {
|
||||
// For whatever reason the event has now appeared so the function that called
|
||||
// this need to whatever it wanted to do with the event.
|
||||
Q_EMIT extraEventLoaded(eventId);
|
||||
return;
|
||||
}
|
||||
auto job = connection()->callApi<GetOneRoomEventJob>(id(), eventId);
|
||||
|
||||
Reference in New Issue
Block a user