aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.h
AgeCommit message (Collapse)Author
2018-07-04Add more #includes missingKitsune Ral
2018-07-04Support ignoring usersKitsune Ral
Closes #215.
2018-06-30Use C++14 [[deprecated]] attribute instead of doc-commentKitsune Ral
Testing the waters in one place to start with.
2018-06-11Connection: InFore/Background -> Fore/BackgroundRequestKitsune Ral
2018-06-08csapi: Fix boolean query parameters incorrectly passedKitsune Ral
2018-06-02Connection::loadedRoomState() signalKitsune Ral
Closes #211.
2018-05-29BaseJob: "background" switch; more extensive error reportingKitsune Ral
Running a request in background, aside from some tweaks on the network layer (see QNetworkRequest::BackgroundRequestAttribute), allows to distinguish jobs not immediately caused by user interaction (such as fetching thumbnails). This can be used to show or not show certain notifications in UI of clients. Error reporting has been extended with more methods: errorCaption() - a human-readable phrase calculated from the status code; intended to be shown as a dialog caption and in similar situations. errorRawData() - former errorDetails(), returns the raw response from the server. errorUrl() - returns a URL that may be useful with the error (e.g. for the upcoming "consent not given" error, this will have the policy URL). Connection::resultFailed() - a new signal emitted when _any_ BaseJob::failure() is emitted (enables centralised error handling across all network requests in clients). As a part of matching changes in Connection, callApi has an overload that allows to specify the policy; a custom enum instead of bool has been chosen for the parameter type, to avoid clashes with (arbitrary) types of job parameters.
2018-05-23BaseJob: more careful error handling; unify and extend error signals in ↵Kitsune Ral
Connection (Note: this commit breaks back-compatibility.) BaseJob::gotReply() had a bold assumption that whenever there's no reasonable JSON body in case of error, that meant IncorrectRequestError (which of course was incorrect). This led to syncs dying in Quaternion because it (correctly) considered IncorrectRequestError to be grave enough to not retry. Closes #206. Also: don't dump the whole payload to logs, limit with initial 500 characters (closes #205)
2018-05-04New home for the generated code - lib/csapiKitsune Ral
2018-05-04Connection, jobs/generated: Use QStringList instead of QVector<QString>Kitsune Ral
QStringList's API is richer, after all.
2018-05-03GetRoomEventsJob (replaces RoomMessagesJob) + refactoringKitsune Ral
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.
2018-04-13Support Qt 5.4Kitsune Ral
That is until ubports move to xenial.
2018-04-02Fixes according to results of static analysisKitsune Ral
Many thanks to clang-tidy and clazy authors for the tools, and to Qt Creator developers for making them easily available in the IDE.
2018-04-02Room/Connection: accountData()/accountDataChanged()Kitsune Ral
Generic account data are at least readable now (you can get, say, pushers from the library without it even being aware of what a pusher is).
2018-04-01Pass actual changes with Connection::directChatsListChanged()Kitsune Ral
Also: provide Connection::directChats() to get the whole direct chats map.
2018-03-31Move source files to a separate folderKitsune Ral
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/).