Do not always re-notify user on existing folder now big if this folder already black or white listed

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-07-24 17:05:44 +08:00
parent 2324a60c76
commit 449bac837b
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -1264,15 +1264,24 @@ void Folder::slotExistingFolderNowBig(const QString &folderPath)
bool ok2 = false; bool ok2 = false;
auto blacklist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok1); auto blacklist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok1);
auto whitelist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok2); auto whitelist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok2);
if (ok1 && ok2 && !blacklist.contains(trailSlashFolderPath) && !whitelist.contains(trailSlashFolderPath)) {
const auto inDecidedLists = blacklist.contains(trailSlashFolderPath) || whitelist.contains(trailSlashFolderPath);
if (inDecidedLists) {
return;
}
auto relevantList = stopSyncing ? blacklist : whitelist;
const auto relevantListType = stopSyncing ? SyncJournalDb::SelectiveSyncBlackList : SyncJournalDb::SelectiveSyncWhiteList;
if (ok1 && ok2 && !inDecidedLists) {
relevantList.append(trailSlashFolderPath);
journal->setSelectiveSyncList(relevantListType, relevantList);
if (stopSyncing) { if (stopSyncing) {
blacklist.append(trailSlashFolderPath); // Abort current down sync and start again
journal->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blacklist);
slotTerminateSync(); slotTerminateSync();
scheduleThisFolderSoon(); scheduleThisFolderSoon();
} else {
whitelist.append(trailSlashFolderPath);
journal->setSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, whitelist);
} }
} }