diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-01-31 01:20:57 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:34:52 +0100 |
commit | a5e84c51e9c89021edc8aaade8c751fb6d39cb89 (patch) | |
tree | 1496a715c918599d342359e358b22edb23efae7d /lib/crypto/qolmsession.cpp.back | |
parent | fe9b2f918753d40d93f8aecf182485e75d4b75bb (diff) | |
download | libquotient-a5e84c51e9c89021edc8aaade8c751fb6d39cb89.tar.gz libquotient-a5e84c51e9c89021edc8aaade8c751fb6d39cb89.zip |
remove old files
Diffstat (limited to 'lib/crypto/qolmsession.cpp.back')
-rw-r--r-- | lib/crypto/qolmsession.cpp.back | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/crypto/qolmsession.cpp.back b/lib/crypto/qolmsession.cpp.back deleted file mode 100644 index ee8b2a7f..00000000 --- a/lib/crypto/qolmsession.cpp.back +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org> -// -// SPDX-License-Identifier: LGPL-2.1-or-later - -#include "olm/qolmsession.h" - -using namespace Quotient; - -std::optional<OlmMessage> fromTypeAndCipthertext(size_t messageType, const QByteArray &ciphertext) -{ - if (messageType == OLM_MESSAGE_TYPE_PRE_KEY) { - return PreKeyMessage { ciphertext }; - } else if (messageType == OLM_MESSAGE_TYPE_MESSAGE) { - return QOlmMessage { ciphertext }; - } - return std::nullopt; -} - -std::pair<OlmMessageType, QByteArray> toPair(const OlmMessage &message) -{ - return std::visit([](auto &arg) { - using T = std::decay_t<decltype(arg)>; - if constexpr (std::is_same_v<T, QOlmMessage>) { - return std::make_pair<OlmMessageType, QByteArray>(MessageType, QByteArray(arg.message)); - } else if constexpr (std::is_same_v<T, PreKeyMessage>) { - return std::make_pair<OlmMessageType, QByteArray>(PreKeyType, QByteArray(arg.message)); - } - }, message); -} |