Fix session always being rotated if 'verified only' is active

This commit is contained in:
Nicolas Werner 2021-08-31 16:40:31 +02:00
parent 529c93503d
commit 98533f01d9
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -3759,7 +3759,8 @@ Cache::getMembersWithKeys(const std::string &room_id, bool verified_only)
if (res) { if (res) {
auto k = json::parse(keys).get<UserKeyCache>(); auto k = json::parse(keys).get<UserKeyCache>();
if (verified_only) { if (verified_only) {
auto verif = verificationStatus(std::string(user_id)); auto verif = verificationStatus_(std::string(user_id), txn);
if (verif.user_verified == crypto::Trust::Verified || if (verif.user_verified == crypto::Trust::Verified ||
!verif.verified_devices.empty()) { !verif.verified_devices.empty()) {
auto keyCopy = k; auto keyCopy = k;
@ -3807,7 +3808,8 @@ Cache::getMembersWithKeys(const std::string &room_id, bool verified_only)
cursor.close(); cursor.close();
return members; return members;
} catch (std::exception &) { } catch (std::exception &e) {
nhlog::db()->debug("Error retrieving members: {}", e.what());
return {}; return {};
} }
} }