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:
committed by
Tobias Fella
parent
ad993d4340
commit
10123abc5b
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user