Ignore non-connected databases from search with Browser Integration (#1810)

This commit is contained in:
Sami Vänttinen 2018-05-04 23:06:07 +03:00 committed by Jonathan White
parent a910821506
commit 658298bc31
3 changed files with 29 additions and 8 deletions

View file

@ -240,9 +240,17 @@ QJsonObject BrowserAction::handleGetLogins(const QJsonObject& json, const QStrin
return getErrorReply(action, ERROR_KEEPASS_NO_URL_PROVIDED);
}
const QJsonArray keys = decrypted.value("keys").toArray();
StringPairList keyList;
for (const QJsonValue val : keys) {
const QJsonObject keyObject = val.toObject();
keyList.push_back(qMakePair(keyObject.value("id").toString(), keyObject.value("key").toString()));
}
const QString id = decrypted.value("id").toString();
const QString submit = decrypted.value("submitUrl").toString();
const QJsonArray users = m_browserService.findMatchingEntries(id, url, submit, "");
const QJsonArray users = m_browserService.findMatchingEntries(id, url, submit, "", keyList);
if (users.isEmpty()) {
return getErrorReply(action, ERROR_KEEPASS_NO_LOGINS_FOUND);