diff --git a/src/jamidht/server_account_manager.cpp b/src/jamidht/server_account_manager.cpp index 33d66617e6cd0b985512a9fdfc77e51f1c768245..db3a4d9c047dced1d9c65f44df5ee3022a955a01 100644 --- a/src/jamidht/server_account_manager.cpp +++ b/src/jamidht/server_account_manager.cpp @@ -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());