aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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-01Reinstate Omittable<>::omitted (deprecated)Kitsune Ral
To ease on back-compatibility.
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-21Merge branch 'kitsune-quotest2'Kitsune Ral
2019-10-21ConnectionData: fix read-after-free in clearing the job queueKitsune Ral
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-18qmc-example -> quotest, QMCTest -> TestManagerKitsune Ral
Also: some bits of refactoring in the test code to make it more extensible. Closes #352.
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-10-02Fix Room::localAliases()Black Hat
When homeserver's csapi is in a subdomain, e.g. matrix.example.org, the authority of api endpoint url differs from server name, example.org. This causes Room::localAliases() to fail.
2019-10-02BaseJob::Private: experiment with [[nodiscard]]Kitsune Ral
2019-10-02More fixes for Apple not having deduction guides in stdlibKitsune Ral
2019-10-02wrap_in_function()Kitsune Ral
Because Apple stdlib doesn't have std::function deduction guides.
2019-10-01Room::getCurrentState()Kitsune Ral
2019-09-29Connection: allRooms(), rooms(), roomsCount(); deprecate roomMap()Kitsune Ral
Closes #354.
2019-09-29BaseJob, urlForLog() -> dumpRequest(): include HTTP verb into log linesKitsune Ral
2019-09-29Rename pieces with qmc/qmatrixclientKitsune Ral
2019-09-29function_traits: drop unused piecesKitsune Ral
is_callable won't ever be needed because std::is_invokable is here; arg_number and returns() didn't find its users; and function_type has been just broken all along for member functions.
2019-09-29Simplify visit() signatureKitsune Ral
Checking that BaseEventT descends from Event is really extraneous.
2019-09-29Make connectSingleShot work wherever QObject::connect worksKitsune Ral
Also: doc-comment connectUntil and unify implementation of both functions.
2019-09-29Settings: childGroups() should merge legacy and current groups; QMC->QTNT in ↵Kitsune Ral
macros Because otherwise migrating one group to the current location leads to all other groups suddenly disappearing from Settings view.
2019-09-29Fix formatting weirdnessKitsune Ral
Alas, clang-format is not terrifically good around [[attributes]]
2019-09-24Room: cleanupKitsune Ral
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-29Merge pull request #348 from quotient-im/kitsune-better-basejobKitsune Ral
Better BaseJob
2019-08-27More compliant 'using' for chrono_literalsKitsune Ral
Compilers warn on using 'using ...::operator""s' because they think we're redefining the reserved suffix.
2019-08-27Don't use enumerator attributesKitsune Ral
Anything after enumerators is a problem for moc before Qt 5.12; so we can't use enumerator attributes before then.
2019-08-27Tighten the code; add a missing #includeKitsune Ral
MSVC warns on class/struct mismatch and errors on std::array because `<array>` is not indirectly included on that platform.
2019-08-26Room::calculateDisplayname: use local aliases for room namingKitsune Ral
The Spec now allows it, even if with a disclaimer that it's subject for further removal.
2019-08-26setAvatarForRoom: try recover from otherAvatars inconsistencyKitsune Ral
Hopefully manages cases like #347 in a better way.
2019-08-25RoomMessageEvent::content(): constify event contentKitsune Ral
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-20BaseJob: Status/StatusCode tweaks, cleanup, mo' commentsKitsune Ral
Notably, recovered Status::fromHttpCode() that was introduced in 5722ceaf4bd10c29f1091e3dc5a87f5650ea8c71 but fell victim of a careless merge (so much for introducing non-topical changes in feature branches).
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-19Room::Private::doSendEvent: fix too early change in BaseJob signalsKitsune Ral
That's a matter of another upcoming commit.
2019-08-18room.cpp: applied clang-format with updated penalty valuesKitsune Ral
2019-08-18Room: use new logging categoriesKitsune Ral
2019-08-18Room::decryptMessage: now with the header file changesKitsune Ral
2019-08-18Merge pull request #345 from rpallai/UnreadNotifsChangeKitsune Ral
Update the cache for sure if unread counters were changed
2019-08-18Room::decryptMessage: fix memory leaks and dangling pointersKitsune Ral
2019-08-18New logging categories: events.state, events.messages, and e2eeKitsune Ral
2019-08-17Update the cache for sure if unread counters were changedRoland Pallai
In Quaternion, I was able to reproduce a process where `d->notificationCount` and `d->highlightCount` were changed in `Room::updateData()` meanwhile `roomChanges` indicated `NoChange` thus the cache became permanently inconsistent with running state. Without deep understanding of `roomChanges` logic, I've applied this straightforward change which made this phenomenon unreproducible.
2019-08-16BaseJob: support M_USER_DEACTIVATED error codeKitsune Ral
Closes #344.
2019-08-13Support for server notices rooms (MSC1452)Kitsune Ral
Closes #326.
2019-08-12e2ee.h: Make constants inline instead of staticKitsune Ral
This changes from internal linkage for every translation unit including e2ee.h to external linkage across translation units but without the need to create a .cpp file just to define and init the constants.
2019-08-12Make Settings::remove() to clear the legacy; more doc-commentsKitsune Ral
2019-08-11Use [[maybe_unused]] instead of [[gnu::unused]]Kitsune Ral