Age | Commit message (Collapse) | Author |
|
|
|
|
|
That `std::move(_data)` never worked because the passed object is
a precursor to RequestData, and RequestData always takes things by
const-ref or by value, never by rvalue. Also, explicit mention of
RequestData is unnecessary, as its constructors are implicit by design.
|
|
|
|
|
|
|
|
|
|
|
|
Code generation in libQuotient is pretty sensitive to GTAD version
(or even a particular commit at times); so it makes sense to have GTAD
as a submodule in order to control the revision CI uses.
(amended with the GTAD commit that uses the right yaml-cpp commit)
|
|
Also: drop inlining PublicRoomResponse by the name because it's already
inlined by $ref before that. This configuration needs the latest GTAD
(revision 51c53ed3) to work correctly; earlier GTAD will produce FTBFS
code.
|
|
This requires OneTimeKeys in keys.yaml to be marked as such (done in
quotient-im/matrix-spec but it's not there in matrix-org/matrix-spec).
|
|
Also: use quotient-im/matrix-spec main branch again, now that it has
adjusted definitions; drop un(der)used partials
|
|
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
|
|
|
|
This is meant to spare clients from having to percent-encode
room aliases, v3 event ids etc. that happen to hit the endpoint path.
It is unfair to expect clients to do that since they are not supposed
to care about the shape of CS API, which parameter should be encoded
in which way. The trick (together with the slightly updated GTAD
configuration) is to percent-encode parts that happen to be QStrings
and not `const char[]`'s while passing all constant parts as plain
C character literals. This also allows to make it more certain that
the path is correctly encoded by passing and storing QByteArray's
wherever the path is already encoded, and only use QStrings (next to
const char arrays) before that.
Since the change alters the API contract (even if that contract was
crappy), some crude detection of percent-encoded stuff on input is
inserted; if input is already percent-encoded, a warning is put to
the logs, alerting developers about the change.
|
|
|
|
It's about to be deprecated in the next commits.
|
|
|
|
|
|
|
|
|
|
An SPDX comment in the source code did not collapse entirely.
|
|
Among things affecting Quotient, the update involved moving API files
from api/ to data/api/, adding extensions to event schema files, and
switching from ReStructured Text to Markdown as a lightweight markup
language. This commit updates the build system and GTAD configuration
to accommodate for these.
The build system is also more robust now in choosing whether the
update-api target should be provided. Previously the target was provided
whenever GTAD_PATH and MATRIX_DOC_PATH were specified, even if they
did not point to anything valid. CMake now checks that MATRIX_DOC_PATH
is an actual directory and that GTAD_PATH points to an actual file.
# Conflicts:
# CMakeLists.txt
|
|
After going through all the files and the history of commits on them
it was clear that some copyright statements are obsolete (the code has
been overwritten since) and some are missing. This commit tries best to
remedy that, along with adding SPDX tags where they were still not used.
Also, a minimal SPDX convention is documented for further contributions.
Closes #426.
|
|
|
|
The Quotient:: workaround seems no more necessary.
|
|
|
|
- The generated code is updated to be compatible with the BaseJob
changes introduced in the previous commit. This includes greatly
reducing the number of header files that have to be explicitly
#included, as basejob.h now #includes converters.h. Also, thanks to
the changes in BaseJob, none of generated job classes needs
a pimpl Private class.
- gtad/template.*.mustache files are replaced with data.h.mustache for
data structures (entirely defined in header files from now on) and
operation.*.mustache for API operations (also massively moved to
header files, possibly also becoming header-only in the future).
- New variable-dropping and title-overring features in GTAD 0.7 allow
to use the upstream matrix-doc repo to generate the code.
- CMakeLists.txt makes use of file globbing with CONFIGURE_DEPENDS
where possible to alleviate build reconfiguration after a GTAD call.
|
|
All GTAD-related files (gtad.yaml and templates) from now live in their
dedicated gtad/ directory - this helps against removing them
accidentally along with the rest of the generated files. The format
to list generated files in gtad.yaml has changed a bit before
GTAD 0.7 beta2; gtad.yaml in this commit conforms to the new structure.
|