Age | Commit message (Collapse) | Author |
|
QUrl can now be converted even with QT_NO_URL_CAST_FROM_STRING; and it
can also be put to queries. QByteArray did not really need conversion
in JSON context; and QJsonObject is/was never used in queries.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
That breaks API all over the place but:
1. The fixes are trivial.
2. More of std:: is used instead of home-baking the same stuff.
|
|
Invading into std:: is frowned upon, even though legitimate from the C++ standard perspective. Given that it's possible to pass a hash object to unordered_map, it only takes an alias for std::unordered_map to avoid having to specialize std::hash. And besides, a generic compatibility bridge between qHash and std::hash has been long needed.
std::hash<QString> in converters.h remains for now; it will be dropped separately when the API files get regenerated to use UnorderedMap.
|
|
|
|
|
|
|
|
general improvements
Single-argument fromJson<Omittable<T>>() now works as well.
|
|
[skip ci]
|
|
# Conflicts:
# CMakeLists.txt
# lib/avatar.cpp
# lib/connection.cpp
# lib/connection.h
# lib/connectiondata.cpp
# lib/csapi/account-data.cpp
# lib/csapi/account-data.h
# lib/csapi/capabilities.cpp
# lib/csapi/capabilities.h
# lib/csapi/content-repo.cpp
# lib/csapi/create_room.cpp
# lib/csapi/filter.cpp
# lib/csapi/joining.cpp
# lib/csapi/keys.cpp
# lib/csapi/list_joined_rooms.cpp
# lib/csapi/notifications.cpp
# lib/csapi/openid.cpp
# lib/csapi/presence.cpp
# lib/csapi/pushrules.cpp
# lib/csapi/registration.cpp
# lib/csapi/room_upgrades.cpp
# lib/csapi/room_upgrades.h
# lib/csapi/search.cpp
# lib/csapi/users.cpp
# lib/csapi/versions.cpp
# lib/csapi/whoami.cpp
# lib/csapi/{{base}}.cpp.mustache
# lib/events/accountdataevents.h
# lib/events/eventcontent.h
# lib/events/roommemberevent.cpp
# lib/events/stateevent.cpp
# lib/jobs/basejob.cpp
# lib/jobs/basejob.h
# lib/networkaccessmanager.cpp
# lib/networksettings.cpp
# lib/room.cpp
# lib/room.h
# lib/settings.cpp
# lib/settings.h
# lib/syncdata.cpp
# lib/user.cpp
# lib/user.h
# lib/util.cpp
|
|
|
|
|
|
Both now use through a common JsonConverter<> template class with its
base definition tuned for structs/QJsonObjects and specialisations for
non-object types. This new implementation doesn't work with virtual
fillJson functions yet (so EventContent classes still use toJson as a
member function) and does not cope quite well with non-constructible
objects (you have to specialise JsonConverter<> rather than, more
intuitively, JsonObjectConverter<>), but overall is more streamlined
compared to the previous implementation. It also fixes one important
issue that pushed for a rewrite: the previous implementation was not
working with structure hierarchies at all so (in particular) the Filter
part of CS API was totally disfunctional.
|
|
- registerEventType(): comment the cryptic _ variable
- Room::postEvent: document the return value
- Room::Private: upgrade comments to doc-comments - even though in Private, they still are helpful to show hints in IDEs.
- General cleanup
|
|
This commit consists of two parts: upgrading the API infrastructure and trivial but sweeping update to the generated files.
1. The API infrastructure (converters.h, *.mustache and some other non-generated files) now can deal with top-level JSON arrays and response inlining; better supports property maps; and gets some formatting fixes in generated code.
2. Generated files now use QJsonValue instead of QJsonObject as a default type
to (un)marshall Matrix API data structures, to match the change in the infrastructure above
This commit is still using the old Matrix API definitions, before CS API 0.4.0. Getting to CS API 0.4.0 will come next.
|
|
The Spec wasn't entirely consistent on this until recently but floats actually are used in the wild, rather than strings.
|
|
Most of the actual change was in the API definition files (thanks to @anoadragon453), plus a converter from a QJsonObject map to the URL query string.
|
|
|
|
|
|
There were two common points that had to be updated every time a new event is introduced:
the EventType enumeration and one of 3 doMakeEvent<> specialisations. The new code
has a template class, EventFactory<>, that uses a list of static factory methods
to create events instead of typelists used in doMakeEvent<>(); the EventType enumeration
is replaced with a namespace populated with constants as necessary.
In general, EventType is considered a deprecated mechanism altogether; instead, a set
of facilities is provided: is<>() to check if an event has a certain type (to replace
comparison against an EventType value) and visit<>() to execute actions based on
the event type (replacing switch statements over EventType values).
Closes #129.
|
|
|
|
Also: toJson<optional> is no more (was #if 0'd anyway).
|
|
Some folks are still on Ubuntu vivid :(
|
|
|
|
Also: GetContentThumbnailJob (again) requires width and height.
|
|
|
|
This mandated some rearrangement of toJson() overloads and FromJson<>
specializations for QVariant* types - instead of variant_converters.h they are
now in converters.cpp.
|
|
|
|
Also: use the latest feature of GTAD, +set/+on, to make gtad.yaml more compact.
|
|
|
|
This is important because payloads that include omitted parameters may be malformed. Closes #208 (an example of such malformed payload).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It's been long overdue to separate them from the rest of the stuff (docs etc.). Also, this allows installing to a directory within the checked out git tree (say, ./install/, similar to ./build/).
|