diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-06-03 02:05:56 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-06-08 22:32:12 +0200 |
commit | 9e983b1584fb7d13c7417725c2f191fdbf82c9d0 (patch) | |
tree | 53629830016af2342146593cce829c67d6d15caa /src | |
parent | Update Qt in Windows CI (diff) | |
download | nheko-9e983b1584fb7d13c7417725c2f191fdbf82c9d0.tar.xz |
Remove a few more QPairs
Diffstat (limited to 'src')
-rw-r--r-- | src/encryption/Olm.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/encryption/Olm.cpp b/src/encryption/Olm.cpp index b4310f26..8993f715 100644 --- a/src/encryption/Olm.cpp +++ b/src/encryption/Olm.cpp @@ -1306,7 +1306,7 @@ send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::s const mtx::events::collections::DeviceEvents &event, bool force_new_session) { - static QMap<QPair<std::string, std::string>, qint64> rateLimit; + static QMap<std::pair<std::string, std::string>, qint64> rateLimit; nlohmann::json ev_json = std::visit([](const auto &e) { return nlohmann::json(e); }, event); @@ -1569,13 +1569,13 @@ send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::s } auto currentTime = QDateTime::currentSecsSinceEpoch(); - if (rateLimit.value(QPair(user.first, device_id.get())) + 60 * 60 * 10 < + if (rateLimit.value(std::pair(user.first, device_id.get())) + 60 * 60 * 10 < currentTime) { deviceKeys[user_id].emplace(device_id, pks); claim_keys.one_time_keys[user.first][device_id] = mtx::crypto::SIGNED_CURVE25519; - rateLimit.insert(QPair(user.first, device_id.get()), currentTime); + rateLimit.insert(std::pair(user.first, device_id.get()), currentTime); } else { nhlog::crypto()->warn("Not creating new session with {}:{} " "because of rate limit", |