Fix getting content models for old events in a search model

Fix getting content models for old events in a search model by allowing for calling using the event. This gets past the intial checks and the content model itself can load the event from the server.

Requires network/neochat!2110 to fix the showauthor issue
This commit is contained in:
James Graham
2025-01-12 15:14:48 +00:00
parent 1d532a1fc1
commit 8a86159fd7
3 changed files with 55 additions and 17 deletions

View File

@@ -120,11 +120,7 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
}
if (role == ContentModelRole) {
auto evtOrTxnId = event->get().id();
if (evtOrTxnId.isEmpty()) {
evtOrTxnId = event->get().transactionId();
}
return QVariant::fromValue<MessageContentModel *>(m_room->contentModelForEvent(evtOrTxnId));
return QVariant::fromValue<MessageContentModel *>(m_room->contentModelForEvent(&event->get()));
}
if (role == GenericDisplayRole) {