aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
AgeCommit message (Collapse)Author
2020-03-31Reparent all jobs to their connectionsKitsune Ral
(Mostly) fixes #397. Fixes #398. If there's a need to reparent the job to some other object, it should now be done after callApi()/run() call (not that there were many touch points before that moment, anyway). Collateral damage: job-starting methods are no more const (but that didn't belong them anyway, too).
2020-03-30Connection::resolveServer(): refactorKitsune Ral
Also: use 4-arg connect() to make sure lambdas are disconnected if the connection is gone.
2020-03-27Fix FTBFS with Quotient_ENABLE_E2EEKitsune Ral
2020-03-26Refactoring around Connection::onSyncSuccess()Kitsune Ral
The method grew large and a bit unwieldy over the years.
2020-03-24Connection: fix a deprecation warningKitsune Ral
2020-03-21Merge pull request #383 from ram-nad/msc2432-fixKitsune Ral
fixing msc2432
2020-03-18SsoSession and Connection::prepareForSso()Kitsune Ral
The response in the web browser is quite barebone, just enough to give feedback that things are alright. Closes #386. Closes #388.
2020-03-15Connection: loginWithToken(); connectWithToken() -> assumeIdentity()Kitsune Ral
2020-03-14Connection: minor cleanupKitsune Ral
2020-03-13Connection: support getting the list of login flowsKitsune Ral
The flows themselves are not facilitated in any way (yet).
2020-03-12E2EE: Make building E2EE optional. Contributes to #369Alexey Andreev
Signed-off-by: Alexey Andreev <aa13q@ya.ru>
2020-03-08fixing msc2432Ram Nad
2020-02-25E2EE: add connection session decrypt, handle to-device and ↵Alexey Andreyev
device_one_time_keys_count Signed-off-by: Alexey Andreev <aa13q@ya.ru>
2020-02-25E2EE: Fix EncryptionManager initialization placeAlexey Andreyev
Signed-off-by: Alexey Andreev <aa13q@ya.ru>
2019-12-23Connection::forgetRoom: slightly simplify codeKitsune Ral
2019-12-12BaseJob: prepare() -> initiate() + refactoring around itKitsune Ral
* BaseJob::initiate() now calls ConnectionData::submit() without relying on Connection to do that * ConnectionData::submit() is now the only site where a job enters Pending state * No more shortcuts to BaseJob::sendRequest(), even retries are sent through the ConnectionData submission queue * Additional validation in BaseJob::initiate() that the request data device is actually open (because QtNetwork API officially requires that, even if you can get away passing a closed QBuffer to it)
2019-12-12Connection::uploadFile/Content(): refactoring around QIODevice::open()Kitsune Ral
No more "The file is already open" log messages.
2019-11-19BaseJob: Don't send accessToken if not needed; send again on 401Kitsune Ral
The first part closes #358; the second part is a workaround for non-standard cases when endpoints without security by the spec turn out to be secured (in particular, the case of authenticating media servers).
2019-11-01Omittable: Add direct-list-initialising operator=; documentKitsune Ral
See the change in connection.cpp for the example of usage. Also: removed static_asserts: the first one is provided by std::optional, and the second one is only relevant to edit().
2019-11-01Omittable: get rid of value()Kitsune Ral
Xcode 10 doesn't have it, and value() is not quite fitting mostly-exceptionless Quotient anyway.
2019-11-01Derive Omittable<> from std::optional<>Kitsune Ral
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.
2019-10-21Connection: record sync timeout; suspend sync before logoutKitsune Ral
This is mostly internal but clients may see fewer spurious sync failures upon logging out.
2019-10-21Connection: make syncLoop() reentrantKitsune Ral
...in the sense that you can call it twice and expect the second invocation to be gracefully ignored rather than two loops conflicting with each other.
2019-10-20Qualify types in signals and Q_INVOKABLEsKitsune Ral
Because https://doc.qt.io/qt-5/moc.html#limitations . For direct connections that doesn't matter but it very much does for queued ones. Along with this DirectChatsMap and IgnoredUsersList have been moved from Connection:: to Quotient::.
2019-10-17Connection::joinRoom: make sure the room object is created early enoughKitsune Ral
All direct slots connected to finished() will run before success() is even emitted; so create the room object in the earliest slot connected to finished(), rather than to success().
2019-09-29Connection: allRooms(), rooms(), roomsCount(); deprecate roomMap()Kitsune Ral
Closes #354.
2019-09-12Introduce HashQ<> and UnorderedMap<>Kitsune Ral
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.
2019-08-20BaseJob/ConnectionData: connection-wide rate-limitingKitsune Ral
As before, completely transparent for clients, driven by 529 errors from the server (but cases of rate limiting are signalled by BaseJob::rateLimited). That brings changes to BaseJob API: timeouts now use int64_t and also can be handled in std::chrono terms; aboutToStart() -> aboutToSendRequest(); started() -> sentRequest(). Closes #292.
2019-08-20Connection::run()Kitsune Ral
Finally, clients can pre-create job objects and then separately submit them for execution on a given connection - previously such separation was a privilege of Connection (others had to use Connection::callApi<>, which invoked jobs right away).
2019-08-20Store userId in ConnectionData instead of ConnectionKitsune Ral
To collect all connection-identifying information in a single place.
2019-08-11Connection: check for cache_type setting in libQuotient groupKitsune Ral
The fallback to libQMatrixClient still remains.
2019-08-09Namespace: QMatrixClient -> Quotient (with back comp alias)Kitsune Ral
2019-08-09Rename zero-impact stringsKitsune Ral
2019-08-02Apply the new brace wrapping to source filesKitsune Ral
2019-08-02Merge branch 'master' into use-clang-formatKitsune Ral
2019-07-27E2EE: introduce EncryptedEventAlexey Andreyev
2019-07-12Minor polishKitsune Ral
2019-07-10Merge pull request #330 from quotient-im/bhat-wellknownKitsune Ral
.well-known support
2019-07-09Add more checks according to the specBlack Hat
2019-07-09Merge branch 'master' into use-clang-formatKitsune Ral
2019-07-09Move serverPart() to the public APIKitsune Ral
Also: Connection::resolveServer() now only accepts MXIDs, not domains.
2019-07-08E2EE: add new account generation logicAlexey Andreyev
2019-07-06Merge branch 'master' into e2ee-enc-mngKitsune Ral
2019-07-06Connection::serverPart: replace auto with QString because of QStringBuilderKitsune Ral
See https://github.com/KDE/clazy/blob/master/docs/checks/README-auto-unexpected-qstringbuilder.md Closes #613.
2019-07-05Clean up .well-known logicBlack Hat
2019-07-04Connection.cpp: Add .well-known parsing in resolveServer()Black Hat
2019-07-04Add EncryptionManager class. Add AccountSettings::encryptionAccountPickle logic.Alexey Andreyev
2019-07-04Connection::token() is no moreKitsune Ral
Use Connection::accessToken() instead.
2019-07-03Room/Connection: make room aliases work properlyKitsune Ral
Closes #301.
2019-07-01Handle M_UNKNOWN as The Spec says; factor out BaseJob::parseError()Kitsune Ral