aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.h
AgeCommit message (Collapse)Author
2021-12-01Store pickling key in qtkeychain and pickle encryptedTobias Fella
2021-12-01Fix build without E2EETobias Fella
2021-12-01Fix FTBFSTobias Fella
2021-12-01Fix everythingCarl Schwan
2021-12-01sslCarl Schwan
2021-12-01E2EE: initial port to internal olm wrapperAlexey Andreyev
Remove qtolm git module. Update CMakeLists.txt. Rename olm to crypto subdir to prevent disambiguation. Rename internal files accordingly. Comment out not ported E2EE API usage.
2021-10-13connection.h: more doc-commentsAlexey Rusakov
2021-09-10Move URL creation to Room/Connection; use query instead of fragmentAlexey Rusakov
The query is easier to manipulate; and the original mxc URL is not used for the real network request anyway.
2021-08-22Drop other stuff deprecated pre- or early 0.6Alexey Rusakov
BaseJob: StatusCode::JsonParseError Connection: resolved() and reconnected() signals; roomMap(); postReceipt() User: bridged() and rawName() ConnectionData: setHost() and setPort() StateEventBase: prev_content()
2021-07-18MembershipType -> Membership, also used for JoinStateAlexey Rusakov
Instead of being defined independently, JoinState now uses values from the Membership enumeration (former MemberEventContent::MembershipType) that was moved to quotient_common.h for that purpose. Both enumerations gained a Q_FLAG_NS decoration and operator<< overrides that strip "Quotient::" prefix when dumping member/join state values to the log - obviating toCString(JoinState) along the way. Quotient::MembershipType alias is deprecated from now.
2021-02-26Add public method to determine if we can change the user passwordCarl Schwan
2021-01-16Updated copyright statements upon Git auditKitsune Ral
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.
2021-01-15Merge pull request #428 from ognarb/licensingKitsune Ral
Port existing copyright statement to reuse using licensedigger
2020-12-28Connection: refactor the resolve/login codeKitsune Ral
1. resolveServer() now emits homeserverChanged() even when there's no .well-known file found. 2. checkAndConnect() entirely removed from the header file. 3. Sunny-day scenario for assumeIdentity() is now asynchronous, triggering a call to /whoami to double-check the user. 4. LoginFlow aliases is moved out from LoginFlows to Quotient namespace.
2020-12-28More comments/documentationKitsune Ral
Notably, recommend using loginFlowsChanged() rather than homeserverChanged() to detect when a Connection object is ready for a login sequence. Related: #427.
2020-12-26Port existing copyright statement to reuse using licensediggerCarl Schwan
2020-11-27Make it compile with QT_NO_KEYWORDSCarl Schwan
2020-09-04Fixes of clazy warningsKitsune Ral
2020-08-03CleanupKitsune Ral
2020-06-19Revert adding a pause between syncs, use sane timeout defaultsKitsune Ral
This reverts commit b1071cf34b86685c3cdb5004d6112881966a7ce6. Passing -1 to sync() and, respectively, to SyncJob does not add any timeout; however, careful reading of the spec reveals that the default value for the timeout (0) means to return as soon as possible, not as late as possible. As a consequence, syncLoop() without parameters initiates a sync polling frenzy, with the client sending a new request as soon as the previous returns, while the server returns the request as soon as it practically can, not as soon as another event for the client comes around. To fix this, the default value for syncLoop() is changed to 30 seconds. The recently added msecBetween parameter is abolished; we really don't want to steer people to classic polling from long polling.
2020-06-14quotient_common.h for common namespace thingsKitsune Ral
The two main cases for this header file are: * namespace QMatrixClient = Quotient should occur exactly once, to respect ODR. * Q_NAMESPACE for namespace Quotient (to enable Q_ENUM_NS, particularly) must be defined exactly once, for the same reason.
2020-06-12Connection::isLoggedIn() and more robust logout()Kitsune Ral
isLoggedIn() is just a wrapper around Connection::accessToken() that returns whether it's not empty. Now, Connection::accessToken() and Connection::logout() are changed in such a way that if there's a logout job ongoing Connection::accessToken() will return an empty value even though the access token is still stored in ConnectionData. This gives a hint to the rest of Connection and to the client code that the user is not quite authenticated anymore. Finally, syncLoop() and sync() have been altered to check isLoggedIn() before proceeding with their network request.
2020-06-12Connection::syncLoop: give a pause between syncsKitsune Ral
As it's observed now, Synapse responds almost immediately on /sync requests - even if there are no events to return. This downgrades long-polling to simply polling, and since clients don't expect it, polling loops become pretty violent. To alleviate that somehow, syncLoop now accepts the second parameter, msecBetween (500 msecs by default), to configure waiting between the previous sync response and the next sync request. This is only for syncLoop(); Connection::sync() fires instantly, as before.
2020-06-12Connection: add (STORED false) to derived Q_PROPERTYsKitsune Ral
2020-06-05Connection::run(): Q_INVOKABLE and chainingKitsune Ral
2020-04-15Connection: track resolving and login flows jobs; isUsable()Kitsune Ral
This is to prevent the jobs from several resolveServer() / setHomeserver() invocations running in parallel.
2020-04-15Connection: cleanup and reformatKitsune Ral
2020-04-15Connection: connectToServer -> loginWithPasswordKitsune Ral
connectToServer() is left for compatibility but deprecated.
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-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-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
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-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-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-09Namespace: QMatrixClient -> Quotient (with back comp alias)Kitsune 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-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-06Fix clazy warningsKitsune Ral
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-06-24Merge branch 'master' into clang-formatKitsune Ral
# 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
2019-05-19Connection: use QScopedPointer instead of unique_ptrKitsune Ral
While theoretically less robust (no equivalent of make_unique), QScopedPointer is navigable in Qt Creator debug views, unlike unique_ptr. Of course this will eventually be fixed; but given that inability to create an owning pointer object means sure abnormal termination of our code shortly afterwards, having make_unique in this particular case doesn't help in any way at all; so unique_ptr has zero advantages over QScopedPointer in this setting.