Fix maximizing replied-to media

The previous index-based handling opened the wrong media, as it used the wrong index.
This commit is contained in:
Tobias Fella
2025-07-07 15:24:08 +02:00
committed by Tobias Fella
parent ad993d4340
commit 10123abc5b
6 changed files with 20 additions and 22 deletions

View File

@@ -236,11 +236,18 @@ void RoomManager::resolveResource(Uri uri, const QString &action)
}
}
void RoomManager::maximizeMedia(int index)
void RoomManager::maximizeMedia(const QString &eventId)
{
if (index < -1 || index > m_mediaMessageFilterModel->rowCount()) {
if (eventId.isEmpty()) {
qWarning() << "Tried to open media for empty event id";
return;
}
const auto index = m_mediaMessageFilterModel->getRowForEventId(eventId);
if (index == -1) {
return;
}
Q_EMIT showMaximizedMedia(index);
}