aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-14 20:13:00 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-16 06:39:33 +0200
commit0599ef6e603dce219b2ba000d7322e8d937753b9 (patch)
tree25193349c08190951a1ac95518bdc5240e8282d5
parentf1ed7eec77f843de689c3f3540db73bb235b2164 (diff)
downloadlibquotient-0599ef6e603dce219b2ba000d7322e8d937753b9.tar.gz
libquotient-0599ef6e603dce219b2ba000d7322e8d937753b9.zip
room.cpp: use return {} where appropriate
-rw-r--r--lib/room.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 0a997b9c..db49e80f 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -372,7 +372,7 @@ public:
// qCWarning(E2EE) << "Unable to decrypt event" << eventId
// << "The sender's device has not sent us the keys for "
// "this message";
- return QString();
+ return {};
}
auto& senderSession = groupSessionIt->second;
if (senderSession->senderId() != senderId) {
@@ -383,7 +383,7 @@ public:
if(std::holds_alternative<QOlmError>(decryptResult)) {
qCWarning(E2EE) << "Unable to decrypt event" << eventId
<< "with matching megolm session:" << std::get<QOlmError>(decryptResult);
- return QString();
+ return {};
}
const auto& [content, index] = std::get<std::pair<QString, uint32_t>>(decryptResult);
const auto& [recordEventId, ts] = q->connection()->database()->groupSessionIndexRecord(q->id(), senderSession->sessionId(), index);
@@ -392,7 +392,7 @@ public:
} else {
if ((eventId != recordEventId) || (ts != timestamp.toMSecsSinceEpoch())) {
qCWarning(E2EE) << "Detected a replay attack on event" << eventId;
- return QString();
+ return {};
}
}
return content;