fix filedownload on maximized view and context menu
- move the logic for remembering local filenames from messagecontentmodel to neochatroom - use it also when maximized and in context menu opening, to stop re-downloading - make onFileTransferCompleted signal connection one-shot (stops memory leak)
This commit is contained in:
@@ -514,11 +514,11 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
||||
if (role == ProgressInfoRole) {
|
||||
if (auto e = eventCast<const RoomMessageEvent>(&evt)) {
|
||||
if (e->hasFileContent()) {
|
||||
return QVariant::fromValue(m_currentRoom->fileTransferInfo(e->id()));
|
||||
return QVariant::fromValue(m_currentRoom->cachedFileTransferInfo(&evt));
|
||||
}
|
||||
}
|
||||
if (auto e = eventCast<const StickerEvent>(&evt)) {
|
||||
return QVariant::fromValue(m_currentRoom->fileTransferInfo(e->id()));
|
||||
if (eventCast<const StickerEvent>(&evt)) {
|
||||
return QVariant::fromValue(m_currentRoom->cachedFileTransferInfo(&evt));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user