Skip to content

Commit

Permalink
Merge pull request #1149 from deXol/develop
Browse files Browse the repository at this point in the history
Remove duplicate service check during import, fix #1148
  • Loading branch information
limpkin authored Feb 16, 2023
2 parents d12b31b + 9649b4a commit 389945a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
29 changes: 1 addition & 28 deletions src/MPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,6 @@ void MPDevice::startMemMgmtMode(bool wantData, bool wantFido,
{
qInfo() << "Mem management mode enabled, DB checked";
force_memMgmtMode(true);
m_isDuplicateServiceDetected = checkDuplicateParentNode();
cb(true, 0, QString());
}
else
Expand Down Expand Up @@ -6077,7 +6076,6 @@ void MPDevice::cleanMMMVars(void)
}
startDataNode = {{MPNode::EmptyAddress},{MPNode::EmptyAddress}};
startNode = {{MPNode::EmptyAddress},{MPNode::EmptyAddress}};
m_isDuplicateServiceDetected = false;
}

void MPDevice::startImportFileMerging(const MPDeviceProgressCb &cbProgress, MessageHandlerCb cb, bool noDelete)
Expand All @@ -6103,8 +6101,6 @@ void MPDevice::startImportFileMerging(const MPDeviceProgressCb &cbProgress, Mess
/* Tag favorites */
tagFavoriteNodes();

m_isDuplicateServiceDetected = checkDuplicateParentNode();

/* We arrive here knowing that the CPZ is in the CPZ/CTR list */
qInfo() << "Starting File Merging...";

Expand Down Expand Up @@ -6260,14 +6256,7 @@ void MPDevice::startImportFileMerging(const MPDeviceProgressCb &cbProgress, Mess
{
cleanImportedVars();
exitMemMgmtMode(false);
if (stringError == Common::DUPLICATE_SERVICE_DETECTED)
{
cb(false, stringError);
}
else
{
cb(false, "Couldn't Import Database: Corrupted Database File");
}
cb(false, "Couldn't Import Database: Corrupted Database File");
return;
}
});
Expand Down Expand Up @@ -7005,14 +6994,6 @@ bool MPDevice::finishImportFileMerging(QString &stringError, bool noDelete)
return false;
}

if (!m_isDuplicateServiceDetected && checkDuplicateParentNode())
{
qCritical() << Common::DUPLICATE_SERVICE_DETECTED;
stringError = Common::DUPLICATE_SERVICE_DETECTED;
cleanImportedVars();
return false;
}

/* Now that we're here, update the change numbers */
if (!isMooltiAppImportFile)
{
Expand Down Expand Up @@ -8169,14 +8150,6 @@ void MPDevice::setMMCredentials(const QJsonArray &creds, bool noDelete,
return;
}

if (!m_isDuplicateServiceDetected && checkDuplicateParentNode())
{
qCritical() << Common::DUPLICATE_SERVICE_DETECTED;
cb(false, Common::DUPLICATE_SERVICE_DETECTED);
exitMemMgmtMode(true);
return;
}

/* Generate save passwords */
if (!packet_send_needed)
{
Expand Down
1 change: 0 additions & 1 deletion src/MPDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ private slots:

bool m_isDebugMsg = false;
bool m_isIntegrityCheck = false;
bool m_isDuplicateServiceDetected = false;
//Message Protocol
MPDeviceBleImpl *bleImpl = nullptr;
DeviceSettings *pSettings = nullptr;
Expand Down
8 changes: 0 additions & 8 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,10 +1154,6 @@ void MainWindow::wantSaveCredentialManagement()
{
errorMessage = tr("Couldn't change all passwords, please approve prompts on the device");
}
else if (Common::DUPLICATE_SERVICE_DETECTED == msg)
{
errorMessage = tr("Duplicated service detected, please contact support");
}
else
{
errorMessage = tr("Couldn't save credentials, please contact the support team with moolticute's log");
Expand Down Expand Up @@ -1569,10 +1565,6 @@ void MainWindow::dbImported(bool success, QString message)
}
else
{
if (message == Common::DUPLICATE_SERVICE_DETECTED)
{
message = tr("Duplicate service detected during import, please contact support");
}
QMessageBox::warning(this, tr("Error"), message);
}

Expand Down

0 comments on commit 389945a

Please sign in to comment.