mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 04:28:49 +03:00
Fix a few more clazy warnings
This commit is contained in:
parent
681e9da668
commit
5fed4d21b1
2 changed files with 5 additions and 3 deletions
|
@ -4424,7 +4424,9 @@ Cache::displayName(const QString &room_id, const QString &user_id)
|
||||||
static bool
|
static bool
|
||||||
isDisplaynameSafe(const std::string &s)
|
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())
|
if (c.isPrint() && !c.isSpace())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1363,12 +1363,12 @@ send_encrypted_to_device_messages(const std::map<std::string, std::vector<std::s
|
||||||
|
|
||||||
auto session = cache::getLatestOlmSession(device_curve);
|
auto session = cache::getLatestOlmSession(device_curve);
|
||||||
if (!session || force_new_session) {
|
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;
|
claims.one_time_keys[user][device] = mtx::crypto::SIGNED_CURVE25519;
|
||||||
pks[user][device].ed25519 = d.keys.at("ed25519:" + device);
|
pks[user][device].ed25519 = d.keys.at("ed25519:" + device);
|
||||||
pks[user][device].curve25519 = d.keys.at("curve25519:" + device);
|
pks[user][device].curve25519 = d.keys.at("curve25519:" + device);
|
||||||
|
|
||||||
rateLimit.insert(QPair(user, device), currentTime);
|
rateLimit.insert(std::pair(user, device), currentTime);
|
||||||
} else {
|
} else {
|
||||||
nhlog::crypto()->warn("Not creating new session with {}:{} "
|
nhlog::crypto()->warn("Not creating new session with {}:{} "
|
||||||
"because of rate limit",
|
"because of rate limit",
|
||||||
|
|
Loading…
Reference in a new issue