aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
2022-06-23Use QUO_CONTENT_GETTERAlexey Rusakov
In keyverificationevent.*, this massively shortens repetitive getter definitions; the remaining few non-trivial ones are moved to keyverificationevent.h, dropping the respective .cpp file and therefore the dedicated translation unit. In roomkeyevent.h, it's just shorter.
2022-06-21CMakeLists: suppress subobject-linkage warningsAlexey Rusakov
GCC (even 12.x) doesn't like when a template parameter is of a pointer/reference type and dumps this warning. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90670
2022-06-17CMakeLists and elsewhere: require Qt 5.15Alexey Rusakov
2022-06-12Require CMake 3.16; extend C++20 to headersAlexey Rusakov
...meaning, clients have to compile in C++20 mode too from now.
2022-05-31Merge branch 'dev' into update-api-updateAlexey Rusakov
2022-05-30Merge pull request #555 from TobiasFella/accountskeychainAlexey Rusakov
Load and store accounts in the keychain
2022-05-29Fix CITobias Fella
2022-05-29Refactor EncryptedFile and EC::FileInfo::fileAlexey Rusakov
Besides having a misleading name (and it goes back to the spec), EncryptedFile under `file` key preempts the `url` (or `thumbnail_url`) string value so only one of the two should exist. This is a case for using std::variant<> - despite its clumsy syntax, it can actually simplify and streamline code when all the necessary bits are in place (such as conversion to JSON and getting the common piece - the URL - out of it). This commit replaces `FileInfo::url` and `FileInfo::file` with a common field `source` of type `FileSourceInfo` that is an alias for a variant type covering both underlying types; and `url()` is reintroduced as a function instead, to allow simplified access to whichever URL is available inside the variant. Oh, and EncryptedFile is EncryptedFileMetadata now, to clarify that it does not represent the file payload itself but rather the data necessary to obtain that payload.
2022-05-27Load and store accounts in the keychainTobias Fella
2022-05-20Provide backwards compatibility for MATRIX_SPEC_PATHTobias Fella
2022-05-20Adapt update-api target to matrix-doc splitTobias Fella
2022-05-16Expected<>Alexey Rusakov
This is a minimal implementation along the lines of `std::expected<>` introduced in C++23; once compilers catch up with C++23 support, it may become simply a typedef of std::expected. There are no tests as yet; but the following commits will introduce QOlmExpected that would replace the current `std::variant<T, QOlmError>` pattern used throughout `QOlm*` classes, automatically pulling Expected under the coverage of `QOlm*` unit tests.
2022-05-08toSnakeCase and EventContent::SingleKeyValueAlexey Rusakov
This is a rework of EventContent::SimpleContent previously defined in simplestateevents.h. Quite a few events (and not only state events) have just a single key-value pair in their content - this structure (which is really just a template wrapper around the value) and the accompanying JsonConverter<> specialisation encapsulate the concept to streamline definition of such events. This commit only has simplestateevents.h using it; further commits will use SingleKeyValue in other places. toSnakeCase is a facility function that converts camelCase used for C++ variables into snake_case used in JSON payloads. Combined with the preprocessor trick that makes a string literal from an identifier, this allows to reduce boilerplate code that repeats the same name for fields in C++ event classes and fields in JSON. SingleKeyValue uses it, and there are other cases for it coming.
2022-05-04CMakeLists.txt: add roomcanonicalaliasevent.hAlexey Rusakov
Yet another missing header from times when .h files weren't added to CMakeLists.
2022-02-13Merge branch 'dev'Alexey Rusakov
The result is FTBFS as yet; next commits will fix that, along with a few other things.
2022-02-07Remove encryptionmanager and various fixesTobias Fella
2022-01-23Move away Omittable static tests to autotests/Alexey Rusakov
These are not required to build libQuotient, and omittable.cpp entirely consisted of them.
2022-01-23RoomStateViewAlexey Rusakov
This class is called to provide an arbitrary snapshot of a room state; as the first step, Room::currentState() returns an instance of this class that stores, well, the current state. Implelementation-wise it's the same hash map of two-part state event keys to const event pointers; however, RoomStateView provides additional operations: - get(), that deprecates Room::getCurrentState(), returns a pointer to a particular event if the current state has it. Unlike the original method, the pointer returned from this one can be nullptr; this is done to get rid of stubbed state events that have to be created everytime a "state miss" occurred (i.e., when getCurrentState() does not find an existing event in the current state). - eventsOfType() - this is a new place for Room::stateEventsOfType() introduced recently. - query() - this is a way to specify a piece of the state content that you need to retrieve by passing a member function or a function object that retrieves it. That is especially convenient with member functions of the event class; just pass the pointer to this member function, and query() will parse the event type it has to retrieve out of it and call that member function on the event object. Returns an Omittable<>; if the respective piece of state doesn't exist, you'll get `Quotient::none` (the same as `std::nullopt`). - queryOr() - the same but with the fallback value; instead of an Omittable<>, the fallback value will be returned if the needed event is not found.
2022-01-23Omittable: split out from util.h and refreshAlexey Rusakov
Improvements: - Quotient::lift() - a way to invoke a function on an optional (including Omittable) or a pointer if it's 'truthy'. Doesn't need enhanced function_traits<>, only the standard library; works on any number of arguments that can be dereferenced and casted to bool. - then() - the version of lift() as a member function. - edit() was renamed to ensure() (edit() might become a read-write counterpart of then() at some point). It's not really used across libQuotient codebase (or elsewhere) but is staying there just in case. It can also accept an initializer, removing the requirement of default-constructibility. - Quotient::merge() is simplified, with one universal implementation covering both Omittable/optional and plain values. - All that now lives in its dedicated pair of files, further decluttering util.h
2022-01-21Merge: merge event relation structures into oneAlexey Rusakov
2022-01-21Redo EventRelation; deprecate RelatesToAlexey Rusakov
RelatesTo and EventRelation have been two means to the same end in two different contexts. (Modernised) EventRelation is the one used now both for ReactionEvent and EventContent::TextContent. The modernisation mostly boils down to using inline variables instead of functions to return relation types and switching to QLatin1String from const char* (because we know exactly that those constants are Latin-1 and QLatin1String is more efficient than const char* to compare/convert to QString).
2022-01-19CMakeLists: Bring back ARCHIVE DESTINATION in install()Alexey Rusakov
The older CMake used by LGTM is still unhappy without it. (See also recent changes to this file.)
2022-01-05CMakeLists: add install(TARGETS) components againAlexey Rusakov
Older CMake versions fail if they don't find those (LGTM uses CMake 3.13 and that one does, at least).
2022-01-01CMakeLists: Drop unneeded parts from install(TARGETS)Alexey Rusakov
Those DESTINATION specifications match precisely what CMake does by default (on Linux at least); what's worse is that they prevent CMake to install the DLL file on Windows.
2021-12-29CMakeLists.txt: apply -fvisibility=hiddenAlexey Rusakov
Also, -fvisibility-inlines-hidden is applied in a CMake-native way now. As can be expected, BUILDING_SHARED_QUOTIENT is set when a dynamic library is built while QUOTIENT_STATIC is set whenever static libQuotient is around (both for building it and for building with it).
2021-12-29Introduce quotient_export.hAlexey Rusakov
Instead of using CMake's generate_export_header macro, it's a bit easier to maintain a static file (that is not supposed to ever change) with necessary export/import/hidden visibility macros.
2021-12-24Apply suggestionsTobias Fella
2021-12-24Prune empty/ish call*event.cpp filesAlexey Rusakov
2021-12-24Find sql when using libquotientTobias Fella
2021-12-21Add event_loader.h to CMakeListsAlexey Rusakov
Another forgotten header file.
2021-12-09Ifdef all the thingsTobias Fella
2021-12-07Rename "crypto" -> "e2ee"Tobias Fella
2021-12-07Port E2EE to database instead of JSON filesTobias Fella
2021-12-03Add a couple of bare .h files to CMakeLists.txtAlexey Rusakov
These were missing from the commit introducing .h files to sources, highlighting the reason why .h files should be there...
2021-12-03Rely on GTAD 0.9 that calls clang-format itselfAlexey Rusakov
There was that ugly workaround in CMakeLists.txt to produce the list of files to be formatted and making a separate build target for clang-format. As GTAD 0.9 calls clang-format itself this workaround is no more necessary; generate-unformatted-api and format-api build targets are now gone, and clang-format is no more one-build-system-configuration behind GTAD on the list of files to handle.
2021-12-03CMakeLists.txt: add .h files to sourcesAlexey Rusakov
This is driven by the change in the way Qt Creator 6 works with CMake (see https://www.qt.io/blog/qt-creator-6-cmake-update) that basically requires you to explicitly add header files as source files. While this obviously added to the size of the source files list, it also drove dropping the repeated file(GLOB_RECURSE ... CONFIGURE_DEPENDS) call which added a considerable speedbump to the beginning of each build (now that call is just one).
2021-12-02Improve function_traits<>; split out from util.*Alexey Rusakov
Quotient::function_traits<> did not support member functions in a proper way (i.e. the way std::invoke_result<> treats them, with the function's owning class represented as the first parameter). Now that I gained the skill and understanding in function_traits<> somewhat wicked machinery, I could properly support member functions. Overloads and generic lambdas are not supported but maybe we'll get to those one day.
2021-12-01Fix compilationCarl Schwan
2021-12-01Store pickling key in qtkeychain and pickle encryptedTobias Fella
2021-12-01Only build the encryptionmanager when encryption is enabledTobias Fella
2021-12-01Implement key verification eventsCarl Schwan
2021-12-01Ifdef E2EE out at cmake levelTobias Fella
2021-12-01Fix cmake codeCarl Schwan
2021-12-01Key verificationCarl Schwan
2021-12-01E2EE: initial port to internal olm wrapperAlexey Andreyev
Remove qtolm git module. Update CMakeLists.txt. Rename olm to crypto subdir to prevent disambiguation. Rename internal files accordingly. Comment out not ported E2EE API usage.
2021-12-01Move filesCarl Schwan
2021-12-01Fix CICarl Schwan
2021-12-01E2EE: Introduce session (WiP)Alexey Andreyev
2021-12-01Improve APICarl Schwan
2021-12-01Depends on OpenSSL for crypo randCarl Schwan