summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-06-03 01:51:36 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-06-08 22:32:11 +0200
commit5fed4d21b1f1f7d6530ef63a79ee3420a691d7d3 (patch)
treec8136a6f38134aed52f94d959d732625788bfbb2
parentUpdate tumbleweed deps (diff)
downloadnheko-5fed4d21b1f1f7d6530ef63a79ee3420a691d7d3.tar.xz
Fix a few more clazy warnings
-rw-r--r--src/Cache.cpp4
-rw-r--r--src/encryption/Olm.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 2d87304c..7671af02 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -4424,7 +4424,9 @@ Cache::displayName(const QString &room_id, const QString &user_id)
 static bool
 isDisplaynameSafe(const std::string &s)
 {
-    for (QChar c : QString::fromStdString(s)) {
+    const auto str = QString::fromStdString(s);
+
+    for (QChar c : str) {
         if (c.isPrint() && !c.isSpace())
             return false;
     }
diff --git a/src/encryption/Olm.cpp b/src/encryption/Olm.cpp
index 733ce94f..b4310f26 100644
--- a/src/encryption/Olm.cpp
+++ b/src/encryption/Olm.cpp
@@ -1363,12 +1363,12 @@ send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::s
 
                 auto session = cache::getLatestOlmSession(device_curve);
                 if (!session || force_new_session) {
-                    if (rateLimit.value(QPair(user, device)) + 60 * 60 * 10 < currentTime) {
+                    if (rateLimit.value(std::pair(user, device)) + 60 * 60 * 10 < currentTime) {
                         claims.one_time_keys[user][device] = mtx::crypto::SIGNED_CURVE25519;
                         pks[user][device].ed25519          = d.keys.at("ed25519:" + device);
                         pks[user][device].curve25519       = d.keys.at("curve25519:" + device);
 
-                        rateLimit.insert(QPair(user, device), currentTime);
+                        rateLimit.insert(std::pair(user, device), currentTime);
                     } else {
                         nhlog::crypto()->warn("Not creating new session with {}:{} "
                                               "because of rate limit",