Skip to content
Snippets Groups Projects
Commit cd603275 authored by Léopold Chappuis's avatar Léopold Chappuis
Browse files

jams-device-revocation: fix daemon not filtering non-revoked devices

Change-Id: Idaf8e45775d2b76a9b306563baa074c7484ff68c
parent d825759a
Branches
Tags
No related merge requests found
......@@ -534,12 +534,19 @@ ServerAccountManager::syncDevices()
} else {
for (unsigned i = 0, n = json.size(); i < n; i++) {
const auto& e = json[i];
const bool revoked = e["revoked"].asBool();
dht::PkId deviceId(e["deviceId"].asString());
if (deviceId) {
if(!deviceId){
continue;
}
if (!revoked) {
this_->info_->contacts->foundAccountDevice(deviceId,
e["alias"].asString(),
clock::now());
}
else {
this_->info_->contacts->removeAccountDevice(deviceId);
}
}
}
} catch (const std::exception& e) {
......@@ -609,7 +616,7 @@ ServerAccountManager::revokeDevice(const std::string& device,
if (json["errorDetails"].empty()) {
if (cb)
cb(RevokeDeviceResult::SUCCESS);
this_->syncDevices();
this_->syncDevices(); // this will remove the devices from the known devices
}
} catch (const std::exception& e) {
JAMI_ERROR("Error when loading device list: {}", e.what());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment