mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Merge pull request #6521 from nextcloud/bugfix/allowWipeData
allow wipe feature to delete data of a wiped user account
This commit is contained in:
commit
747efd4711
2 changed files with 13 additions and 10 deletions
|
@ -438,10 +438,11 @@ Application::~Application()
|
|||
|
||||
void Application::setupAccountsAndFolders()
|
||||
{
|
||||
const auto accountsRestoreResult = restoreLegacyAccount();
|
||||
|
||||
_folderManager.reset(new FolderMan);
|
||||
FolderMan::instance()->setSyncEnabled(true);
|
||||
|
||||
const auto accountsRestoreResult = restoreLegacyAccount();
|
||||
|
||||
const auto foldersListSize = FolderMan::instance()->setupFolders();
|
||||
|
||||
const auto prettyNamesList = [](const QList<AccountStatePtr> &accounts) {
|
||||
|
|
|
@ -34,10 +34,13 @@ RemoteWipe::RemoteWipe(AccountPtr account, QObject *parent)
|
|||
this, [=](AccountState *) {
|
||||
_accountRemoved = true;
|
||||
});
|
||||
QObject::connect(this, &RemoteWipe::authorized, FolderMan::instance(),
|
||||
&FolderMan::slotWipeFolderForAccount);
|
||||
QObject::connect(FolderMan::instance(), &FolderMan::wipeDone, this,
|
||||
&RemoteWipe::notifyServerSuccessJob);
|
||||
if (FolderMan::instance()) {
|
||||
QObject::connect(this, &RemoteWipe::authorized, FolderMan::instance(),
|
||||
&FolderMan::slotWipeFolderForAccount);
|
||||
QObject::connect(FolderMan::instance(), &FolderMan::wipeDone, this,
|
||||
&RemoteWipe::notifyServerSuccessJob);
|
||||
}
|
||||
|
||||
QObject::connect(_account.data(), &Account::appPasswordRetrieved, this,
|
||||
&RemoteWipe::startCheckJobWithAppPassword);
|
||||
}
|
||||
|
@ -109,13 +112,12 @@ void RemoteWipe::checkJobSlot()
|
|||
_account->setRemoteWipeRequested_HACK();
|
||||
// <-- FIXME MS@2019-12-07
|
||||
|
||||
// delete account
|
||||
manager->deleteAccount(accountState);
|
||||
manager->save();
|
||||
|
||||
// delete data
|
||||
emit authorized(accountState);
|
||||
|
||||
// delete account
|
||||
manager->deleteAccount(accountState);
|
||||
manager->save();
|
||||
} else {
|
||||
// ask user for his credentials again
|
||||
accountState->handleInvalidCredentials();
|
||||
|
|
Loading…
Reference in a new issue