diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-01-24 01:45:43 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:34:52 +0100 |
commit | 8706c055e69b01097b702403aaa0d222e5ab0d29 (patch) | |
tree | 063534b589d598a14af2018c516ce5eb992399ff /lib/olm/qolmaccount.cpp | |
parent | c8d67f737e84bbec98a54fc19a8aa56dbc39d542 (diff) | |
download | libquotient-8706c055e69b01097b702403aaa0d222e5ab0d29.tar.gz libquotient-8706c055e69b01097b702403aaa0d222e5ab0d29.zip |
Implement outboundsession
Diffstat (limited to 'lib/olm/qolmaccount.cpp')
-rw-r--r-- | lib/olm/qolmaccount.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/lib/olm/qolmaccount.cpp b/lib/olm/qolmaccount.cpp index bde9b712..89d82832 100644 --- a/lib/olm/qolmaccount.cpp +++ b/lib/olm/qolmaccount.cpp @@ -4,6 +4,7 @@ #ifdef Quotient_E2EE_ENABLED #include "qolmaccount.h" +#include "olm/utils.h" #include <QJsonObject> #include <QJsonDocument> #include <QDebug> @@ -24,37 +25,11 @@ std::optional<QMap<QString, QString>> OneTimeKeys::get(QString keyType) const return keys[keyType]; } -// Convert PicklingMode to key -QByteArray toKey(const PicklingMode &mode) -{ - if (std::holds_alternative<Unencrypted>(mode)) { - return ""; - } - return std::get<Encrypted>(mode).key; -} - bool operator==(const IdentityKeys& lhs, const IdentityKeys& rhs) { return lhs.curve25519 == rhs.curve25519 &&& lhs.ed25519 == rhs.ed25519; } -// TODO use impl from errors.cpp -OlmError fromString(const std::string &error_raw) { - if (error_raw.compare("BAD_ACCOUNT_KEY")) { - return OlmError::BadAccountKey; - } else if (error_raw.compare("BAD_MESSAGE_KEY_ID")) { - return OlmError::BadMessageKeyId; - } else if (error_raw.compare("INVALID_BASE64")) { - return OlmError::InvalidBase64; - } else if (error_raw.compare("NOT_ENOUGH_RANDOM")) { - return OlmError::NotEnoughRandom; - } else if (error_raw.compare("OUTPUT_BUFFER_TOO_SMALL")) { - return OlmError::OutputBufferTooSmall; - } else { - return OlmError::Unknown; - } -} - // Conver olm error to enum OlmError lastError(OlmAccount *account) { const std::string error_raw = olm_account_last_error(account); |