Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
|
|
|
|
* JSON response is stored internally in BaseJob, rather than passed
around virtual response handlers. This allow to lazily deserialise
parts of the JSON response when the client calls for them instead of
deserialising upon arrival and storing POD pieces. This is
incompatible with the current generated code, so temporarily FTBFS.
* BaseJob::loadFromJson() and BaseJob::takeFromJson() have been added
to facilitate picking parts of the result as described above
in derived job classes.
* BaseJob::jsonData(), BaseJob::jsonItems() and (protected)
BaseJob::reply() for direct access to the response in its various
forms.
* To further eliminate boilerplate code in generated job classes,
a group of *ExpectedKeys() methods has been added - this allows to
reflect the API definition of required response keys in a more
"declarative" way, delegating validation to BaseJob.
* parseReply() and parseJson() pair turns to singular prepareResult().
Thanks to all the changes above, in most cases it will not need
overriding, unlike before.
* BaseJob::Private::parseJson() is introduced, to wrap
QJsonDocument::parseJson() into something less verbose. This serves
a completely different purpose to the former BaseJob::parseJson().
* BaseJob::doCheckReply() takes the place, and the name, of
checkReply().
|
|
|
|
# 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
|
|
|
|
|
|
|
|
SyncData now resides in its own pair of files and is capable to load either from file or from JSON. There is also (yet untested) capability to load rooms from files if a file name stands is the value for a given room id. This allows to store the master cache file separately from cache files for each room, massively easing the problem of bulky accounts that can overflow the poor capacity of Qt's JSON engine.
|
|
|
|
Closes #240.
|
|
We now have event.*, roomevent.*, stateevent.* and eventloader.h. If you only use event leaf-classes (such as RoomMemberEvent) you shouldn't notice anything.
|
|
|
|
|
|
|
|
|
|
1. Updates in this commit (see further) allow to generate and build
GetRoomEventsJob from message_pagination.yaml; this job completely
preempts RoomMessagesJob.
2. EventsBatch<> is no more a thing; there's EventsArray<> to replace it
but it's loaded from a JSON array rather than an event batch (a JSON
array inside another JSON object). SyncJob that used it extensively has
been moved to "conventional" containers (Events, RoomEvents and the
newly introduced StateEvents). RoomMessagesJob that also used
EventsBatch<> is decommissioned (see above).
3. RoomEventsRange is now an alias for Range<RoomEvents>, defined in
util.h (otherwise almost the same).
4. Connection::getMessages() is no more. Use Room::getPreviousContent()
and Connection::callApi<GetRooMEventsJob>() instead.
5. Moving things around in Room, since SyncJob now supplies state events
in more specific StateEvents, rather than RoomEvents.
|
|
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/).
|