From 11788dd2ce0c9c4308c749068d2443194dc2b40d Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Fri, 24 Jan 2025 18:39:47 +0100 Subject: [PATCH] Bump the version to 0.10 alpha; stop using old API --- CMakeLists.txt | 6 +++--- Quotient/connectionencryptiondata_p.cpp | 6 +++--- Quotient/events/roommessageevent.cpp | 2 +- Quotient/room.cpp | 2 -- Quotient/room.h | 5 ----- Quotient/util.h | 12 ++---------- 6 files changed, 9 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b47110ff9..5387ecab1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,9 @@ if (POLICY CMP0092) cmake_policy(SET CMP0092 NEW) endif() -set(API_VERSION "0.9") -project(Quotient VERSION "${API_VERSION}.2" LANGUAGES CXX) -set(PRE_STAGE "") +set(API_VERSION "0.10") +project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) +set(PRE_STAGE "alpha") string(JOIN ~ FULL_VERSION ${PROJECT_VERSION} ${PRE_STAGE}) message(STATUS) diff --git a/Quotient/connectionencryptiondata_p.cpp b/Quotient/connectionencryptiondata_p.cpp index 7e9f904ba..90c87d01c 100644 --- a/Quotient/connectionencryptiondata_p.cpp +++ b/Quotient/connectionencryptiondata_p.cpp @@ -411,7 +411,7 @@ void ConnectionEncryptionData::handleEncryptedToDeviceEvent(const EncryptedEvent void ConnectionEncryptionData::handleMasterKeys(const QHash& masterKeys) { - for (const auto &[userId, key] : asKeyValueRange(masterKeys)) { + for (const auto &[userId, key] : masterKeys.asKeyValueRange()) { if (key.userId != userId) { qCWarning(E2EE) << "Master key: userId mismatch" << key.userId << userId; continue; @@ -459,7 +459,7 @@ QString getEd25519Signature(const CrossSigningKey& keyObject, const QString& use void ConnectionEncryptionData::handleSelfSigningKeys(const QHash& selfSigningKeys) { - for (const auto &[userId, key] : asKeyValueRange(selfSigningKeys)) { + for (const auto &[userId, key] : selfSigningKeys.asKeyValueRange()) { if (key.userId != userId) { qCWarning(E2EE) << "Self signing key: userId mismatch"<< key.userId << userId; continue; @@ -505,7 +505,7 @@ void ConnectionEncryptionData::handleSelfSigningKeys(const QHash& userSigningKeys) { - for (const auto &[userId, key] : asKeyValueRange(userSigningKeys)) { + for (const auto &[userId, key] : userSigningKeys.asKeyValueRange()) { if (key.userId != userId) { qWarning() << "User signing key: userId mismatch" << key.userId << userId; continue; diff --git a/Quotient/events/roommessageevent.cpp b/Quotient/events/roommessageevent.cpp index 4d43bb8f5..a4356dbee 100644 --- a/Quotient/events/roommessageevent.cpp +++ b/Quotient/events/roommessageevent.cpp @@ -306,7 +306,7 @@ bool RoomMessageEvent::isThreaded() const { const auto relation = relatesTo(); return (relation && relation.value().type == EventRelation::ThreadType) - || unsignedPart("m.relations"_ls).contains(EventRelation::ThreadType); + || unsignedPart("m.relations"_L1).contains(EventRelation::ThreadType); } QString RoomMessageEvent::threadRootEventId() const diff --git a/Quotient/room.cpp b/Quotient/room.cpp index 6cc92cde0..89c1bd49c 100644 --- a/Quotient/room.cpp +++ b/Quotient/room.cpp @@ -3477,8 +3477,6 @@ QJsonObject Room::Private::toJson() const QJsonObject Room::toJson() const { return d->toJson(); } -MemberSorter Room::memberSorter() const { return MemberSorter(); } - void Room::activateEncryption() { if(usesEncryption()) { diff --git a/Quotient/room.h b/Quotient/room.h index d6012a6bb..6b7c28329 100644 --- a/Quotient/room.h +++ b/Quotient/room.h @@ -664,11 +664,6 @@ class QUOTIENT_API Room : public QObject { */ Q_INVOKABLE QString prettyPrint(const QString& plainText) const; -#if Quotient_VERSION_MAJOR == 0 && Quotient_VERSION_MINOR < 10 - [[deprecated("Create MemberSorter objects directly instead")]] - MemberSorter memberSorter() const; -#endif - Q_INVOKABLE bool supportsCalls() const; /// Whether the current user is allowed to upgrade the room diff --git a/Quotient/util.h b/Quotient/util.h index dde11c1ce..c131454a7 100644 --- a/Quotient/util.h +++ b/Quotient/util.h @@ -111,6 +111,8 @@ inline auto makeReadyValueFuture(T&& value) #endif } +inline namespace Literals { using namespace Qt::Literals; } + #if Quotient_VERSION_MAJOR == 0 && Quotient_VERSION_MINOR < 10 /// This is only to make UnorderedMap alias work until we get rid of it template @@ -125,16 +127,6 @@ template using UnorderedMap [[deprecated("Use std::unordered_map directly")]] = std::unordered_map>; -inline namespace Literals { using namespace Qt::Literals; } - -#if Quotient_VERSION_MAJOR == 0 && Quotient_VERSION_MINOR > 9 -[[deprecated("Use operators from Qt::Literals (aka Quotient::Literals) instead")]] -#endif -constexpr auto operator""_ls(const char* s, std::size_t size) -{ - return operator""_L1(s, size); -} - template class [[deprecated("Use std::ranges::subrange instead")]] Range { using iterator = typename ArrayT::iterator;