Handle devices without keys

This commit is contained in:
Nicolas Werner 2021-01-21 13:21:34 +01:00
parent f47bedff23
commit f31e2ffc7b

View file

@ -961,6 +961,12 @@ send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::s
auto d = deviceKeys->device_keys.at(device); auto d = deviceKeys->device_keys.at(device);
if (!d.keys.count("curve25519:" + device) ||
!d.keys.count("ed25519:" + device)) {
nhlog::crypto()->warn("Skipping device {} since it has no keys!",
device);
}
auto session = auto session =
cache::getLatestOlmSession(d.keys.at("curve25519:" + device)); cache::getLatestOlmSession(d.keys.at("curve25519:" + device));
if (!session || force_new_session) { if (!session || force_new_session) {