aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-04-16 22:09:12 +0200
committerTobias Fella <fella@posteo.de>2022-04-16 22:09:12 +0200
commitc0c4cd014718fdb54ee691ccbdab46981e15d25f (patch)
tree671133c8974569b182a27d82d627929addeb5ad6 /lib
parent06b7093aaa0b5cce58c1191c7e0bf9bdfe135005 (diff)
downloadlibquotient-c0c4cd014718fdb54ee691ccbdab46981e15d25f.tar.gz
libquotient-c0c4cd014718fdb54ee691ccbdab46981e15d25f.zip
Use more idiomatic C++
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 1a5e3c6e..d99ab64d 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -963,17 +963,14 @@ void Connection::Private::consumeToDeviceEvents(Events&& toDeviceEvents)
#ifdef Quotient_E2EE_ENABLED
void Connection::Private::handleEncryptedToDeviceEvent(const EncryptedEvent& event)
{
- const auto [decryptedEvent, id] = sessionDecryptMessage(event);
+ const auto [decryptedEvent, olmSessionId] = sessionDecryptMessage(event);
if(!decryptedEvent) {
qCWarning(E2EE) << "Failed to decrypt event" << event.id();
return;
}
- // Yes, this is weird, but lgtm.com doesn't like it otherwise
- const auto olmSessionId = id;
-
switchOnType(*decryptedEvent,
- [this, senderKey = event.senderKey(), &event, olmSessionId](const RoomKeyEvent& roomKeyEvent) {
+ [this, senderKey = event.senderKey(), &event, olmSessionId = olmSessionId](const RoomKeyEvent& roomKeyEvent) {
if (auto* detectedRoom = q->room(roomKeyEvent.roomId())) {
detectedRoom->handleRoomKeyEvent(roomKeyEvent, event.senderId(), olmSessionId);
} else {