aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/olm/errors.cpp4
-rw-r--r--lib/olm/errors.h4
-rw-r--r--lib/olm/qolmaccount.h3
-rw-r--r--lib/olm/qolminboundsession.cpp2
-rw-r--r--lib/olm/qolminboundsession.h3
-rw-r--r--lib/olm/qolmoutboundsession.cpp5
-rw-r--r--lib/olm/qolmoutboundsession.h2
-rw-r--r--lib/olm/utils.cpp2
-rw-r--r--lib/olm/utils.h2
9 files changed, 24 insertions, 3 deletions
diff --git a/lib/olm/errors.cpp b/lib/olm/errors.cpp
index fce177c6..a687e807 100644
--- a/lib/olm/errors.cpp
+++ b/lib/olm/errors.cpp
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
+// SPDX-License-Identifier: LGPL-2.1-or-later
+#ifdef Quotient_E2EE_ENABLED
#include "olm/errors.h"
Quotient::OlmError Quotient::fromString(const std::string &error_raw) {
@@ -15,3 +18,4 @@ Quotient::OlmError Quotient::fromString(const std::string &error_raw) {
return OlmError::Unknown;
}
}
+#endif
diff --git a/lib/olm/errors.h b/lib/olm/errors.h
index 3dc4c796..09d2a989 100644
--- a/lib/olm/errors.h
+++ b/lib/olm/errors.h
@@ -2,9 +2,9 @@
//
// SPDX-License-Identifier: LGPL-2.1-or-later
-#ifndef QUOTIENT_OLM_ERROR_H
-#define QUOTIENT_OLM_ERROR_H
+#pragma once
+#ifdef Quotient_E2EE_ENABLED
#include <string>
namespace Quotient {
diff --git a/lib/olm/qolmaccount.h b/lib/olm/qolmaccount.h
index 3ce1fb9a..c478c781 100644
--- a/lib/olm/qolmaccount.h
+++ b/lib/olm/qolmaccount.h
@@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#pragma once
+#ifdef Quotient_E2EE_ENABLED
#include "olm/e2ee.h"
#include "olm/errors.h"
@@ -52,3 +53,5 @@ private:
};
} // namespace Quotient
+
+#endif
diff --git a/lib/olm/qolminboundsession.cpp b/lib/olm/qolminboundsession.cpp
index 37dd60f8..f0ca73c4 100644
--- a/lib/olm/qolminboundsession.cpp
+++ b/lib/olm/qolminboundsession.cpp
@@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: LGPL-2.1-or-later
+#ifdef Quotient_E2EE_ENABLED
#include "olm/qolminboundsession.h"
#include <QDebug>
#include <iostream>
@@ -150,3 +151,4 @@ bool QOlmInboundGroupSession::isVerified() const
{
return olm_inbound_group_session_is_verified(m_groupSession) != 0;
}
+#endif
diff --git a/lib/olm/qolminboundsession.h b/lib/olm/qolminboundsession.h
index 82802520..85807821 100644
--- a/lib/olm/qolminboundsession.h
+++ b/lib/olm/qolminboundsession.h
@@ -4,6 +4,8 @@
#pragma once
+#ifdef Quotient_E2EE_ENABLED
+
#include <QByteArray>
#include <variant>
#include "olm/olm.h"
@@ -43,3 +45,4 @@ private:
QByteArray m_buffer;
};
} // namespace Quotient
+#endif
diff --git a/lib/olm/qolmoutboundsession.cpp b/lib/olm/qolmoutboundsession.cpp
index 8a6b966b..60126469 100644
--- a/lib/olm/qolmoutboundsession.cpp
+++ b/lib/olm/qolmoutboundsession.cpp
@@ -1,7 +1,8 @@
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
-//
+
+#ifdef Quotient_E2EE_ENABLED
#include "olm/qolmoutboundsession.h"
#include "olm/utils.h"
@@ -119,3 +120,5 @@ std::variant<QByteArray, OlmError> QOlmOutboundGroupSession::sessionKey() const
}
return keyBuffer;
}
+
+#endif
diff --git a/lib/olm/qolmoutboundsession.h b/lib/olm/qolmoutboundsession.h
index 147c0e03..41eb874a 100644
--- a/lib/olm/qolmoutboundsession.h
+++ b/lib/olm/qolmoutboundsession.h
@@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#pragma once
+#ifdef Quotient_E2EE_ENABLED
#include "olm/olm.h" // from Olm
#include "olm/errors.h"
@@ -45,3 +46,4 @@ private:
QByteArray m_buffer;
};
}
+#endif
diff --git a/lib/olm/utils.cpp b/lib/olm/utils.cpp
index 4966af15..15def1d7 100644
--- a/lib/olm/utils.cpp
+++ b/lib/olm/utils.cpp
@@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: LGPL-2.1-or-later
+#ifdef Quotient_E2EE_ENABLED
#include "olm/utils.h"
using namespace Quotient;
@@ -20,3 +21,4 @@ QByteArray Quotient::getRandom(size_t bufferSize)
std::generate(buffer.begin(), buffer.end(), std::rand);
return buffer;
}
+#endif
diff --git a/lib/olm/utils.h b/lib/olm/utils.h
index ec0da784..85d4605b 100644
--- a/lib/olm/utils.h
+++ b/lib/olm/utils.h
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#pragma once
+#ifdef Quotient_E2EE_ENABLED
#include "olm/e2ee.h"
@@ -11,3 +12,4 @@ namespace Quotient {
QByteArray toKey(const PicklingMode &mode);
QByteArray getRandom(size_t bufferSize);
}
+#endif