Fix attachment order and voice recording path

This commit is contained in:
Julien Wadel 2021-12-03 09:35:09 +01:00
parent a84e2b8326
commit edf43e9f9d
2 changed files with 12 additions and 7 deletions

View file

@ -244,7 +244,7 @@ string Paths::getFriendsListFilePath () {
}
string Paths::getDownloadDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + QDir::separator());
}
std::string Paths::getLimeDatabasePath (){

View file

@ -57,17 +57,22 @@ bool ContentProxyModel::lessThan (const QModelIndex &left, const QModelIndex &ri
const ContentModel *contentB = sourceModel()->data(right).value<ContentModel *>();
bool aIsForward = contentA->getChatMessageModel()->isForward();
bool aIsReply = contentA->getChatMessageModel()->isReply();
bool aIsVoiceRecording = contentA->isVoiceRecording();
bool aIsFile = contentA->isFile() || contentA->isFileEncrypted() || contentA->isFileTransfer();
bool aIsText = contentA->isText() ;
bool bIsForward = contentB->getChatMessageModel()->isForward();
bool bIsReply = contentB->getChatMessageModel()->isReply();
bool bIsVoiceRecording = contentB->isVoiceRecording();
bool bIsFile = contentB->isFile() || contentB->isFileEncrypted() || contentB->isFileTransfer();
bool bIsText = contentB->isText() ;
return aIsForward && !bIsForward
|| aIsReply && !bIsForward && !bIsReply
|| aIsFile && !bIsForward && !bIsReply && !bIsFile
|| aIsText && !bIsForward && !bIsReply && !bIsFile && !bIsText
;
return !bIsForward && (aIsForward
|| !bIsReply && (aIsReply
|| !bIsVoiceRecording && (aIsVoiceRecording
|| !bIsFile && (aIsFile
|| aIsText && !bIsText
)
)
)
);
}