aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-09-05Create a NAM for each threadTobias Fella
2021-09-05Implement the mxc protocol in the NetworkAccessManagerTobias Fella
Allows images to be loaded using the NetworkAccessManager instead of an ImageProvider
2021-08-30Room: displayNameForHtmlAlexey Rusakov
This is useful for cases when the room display name is returned to QML that doesn't have an equivalent of QString::toHtmlEscaped().
2021-08-30SettingsGroup, AccountSettings: simplify constructorsAlexey Rusakov
The parameter packs intended to pass organisation/application names to QSettings never worked that way since Quotient::Settings didn't have that parameter pack in its constructor. On the other hand, setting organisation/application name using static methods before constructing the first settings object has been working just fine so far. If someone needs to create a settings object with customised org/app name for some reason (sneaking settings from other apps?), those can be brought back in a working manner and without breaking API/ABI even.
2021-08-26Add AccountRegistryTobias Fella
Basic session management class; Created from Quaternion's AccountRegistry and NeoChat's AccountListModel. The connections can be accessed by the user's id, this technically limits it to one connection for each matrix account.
2021-08-23Room: isMember(); memberState() only needs user idAlexey Rusakov
Room::memberJoinState() was only used to check if the user has joined the room (it couldn't be used for anything else), meaning that its best replacement is actually not memberState() but isMember() introduced hereby. It's also better to pass user ids instead of User objects to memberState() and isMember() since that is enough to check membership. # Conflicts: # lib/room.cpp # lib/room.h
2021-08-23Merge branch 'kitsune/deprecations'Alexey Rusakov
2021-08-22User::isGuest(): fix a clazy warningAlexey Rusakov
2021-08-22Fix building with MSVCAlexey Rusakov
2021-08-22RoomEvent: drop timestamp()Alexey Rusakov
Use originTimestamp(); the corresponding Q_PROPERTY was not renamed (in error) so it is now.
2021-08-22Settings: no more setToken() and accessToken(); deprecate clearAccessToken()Alexey Rusakov
Access tokens should be stored with Qt Keychain that's about to come; and these methods were deprecated since before 0.5.
2021-08-22Use Q_DECL_DEPRECATED_X instead of \deprecated doc-commentAlexey Rusakov
This still works with older moc yet produces actual warnings when compiling C++ code.
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-08-22Drop QMatrixClient namespace aliasAlexey Rusakov
2021-08-22Deprecate BaseJob::DataAlexey Rusakov
The grand plan is to get rid of `BaseJob` and turn job invocations to function calls returning `QFuture`. `RequestData` will stay though, feeding data into those calls.
2021-08-22Regenerate API filesAlexey Rusakov
2021-08-21CleanupAlexey Rusakov
2021-08-10Turn EventStatus from a class to a namespaceAlexey Rusakov
This wrapper only exists for an enum inside of it and dates back to times when Qt meta-object system did not support free-standing enums.
2021-08-10Room::Private::sync/historyEdge()Alexey Rusakov
Move Room::sync/historyEdge() implementation to Room::Private, so that internal logic could use the same readable shortcuts without q-> prefixes, instead of timeline.crend() and timeline.cend() that are much less readable.
2021-08-09Merge pull request #492 from quotient-im/kitsune-qurl-in-csapiAlexey Rusakov
Use QUrl in CS API backend
2021-08-07Update non-generated code to work with QUrls in CS APIAlexey Rusakov
2021-08-07Update generated filesAlexey Rusakov
This uses API definition files from https://github.com/matrix-org/matrix-doc/pull/3236, and additionally makes uploadFile>content_uri to have 'format: uri' (as suggested in the PR review). Only use this commit with the next one; alone it breaks the build.
2021-08-07User::avatar: add constAlexey Rusakov
2021-08-07converters.h: (actually) enable QUrl; drop unused typesAlexey Rusakov
QUrl can now be converted even with QT_NO_URL_CAST_FROM_STRING; and it can also be put to queries. QByteArray did not really need conversion in JSON context; and QJsonObject is/was never used in queries.
2021-08-07Drop an out-of-date commentAlexey Rusakov
BaseJob::loadFromJson() does just fine without QStringViews. [skip ci]
2021-08-07API files: reformat after .clang-format changeAlexey Rusakov
See 000b5730.
2021-08-02Fix lack of percent encoding in User::load()Alexey Rusakov
Users with slashes in their ids do it at their own peril of course but to encode the id in the URL is a good thing in any case. Too bad it's pretty invisible and has to be dealt with case by case, instead of GTAD magically sticking QUrl::toPercentEncoding() where appropriate in the generated code.
2021-08-02More doc-commentsAlexey Rusakov
2021-07-31Room: Mark dependent Q_PROPERTYs as STORED falseAlexey Rusakov
hasUnreadMessages is derived from unreadCount; isFavourite/isLowPriority effectively depend on tagNames.
2021-07-30Clean up after the previous commitAlexey Rusakov
RoomAliasesEvent is no more even registered (meaning that the library will load m.room.aliases as unknown state events); quotest code updated to use historyEdge() instead of timelineEdge().
2021-07-30Use a better type in makeRedactedAlexey Rusakov
2021-07-30Room: drop 0.6 deprecations; deprecate RoomAliasEventAlexey Rusakov
Namely memberCount(), localAliases(), remoteAliases(), timelineEdge().
2021-07-30FormattingAlexey Rusakov
2021-07-28setFirst/LastDisplayedEvent(): warn about unloaded eventsAlexey Rusakov
2021-07-24Wrap SyncRoomData counters into OmittablesAlexey Rusakov
Also: introduce a merge(T1&, const Omittable<T2>&) that does pretty much the same as Omittable<T1>::merge(const Omittable<T2>&) except it works on non-omittables as the left/first operand. The change removes the need for a clumsy -2 fallback in unreadCount, and makes the logic loading those counters cleaner along the way.
2021-07-24Make operator ""_ls constexprAlexey Rusakov
2021-07-18Merge branch 'kitsune-member-state-enum' into masterAlexey Rusakov
2021-07-18Add a missing #includeAlexey Rusakov
Without this, it compiles on Linux but on macOS and Windows.
2021-07-18Fix bit rot in commentsAlexey Rusakov
2021-07-18Introduce to_array() to fix building on macOSAlexey Rusakov
A previous incarnation, make_array, existed in basejob.cpp before. The new direction taken by C++20 is to either deduce the array (but the used Apple standard library doesn't have deduction guides yet) or to use to_array() that converts a C array to std::array. This latter option is taken here, with to_array() defined in quotient_common.h until we move over to C++20.
2021-07-18Fix building with Qt 5.12Alexey Rusakov
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-07-18Re-apply the previous commit and actually fix the breakageAlexey Rusakov
Ok, it was stupid to delete #include <QtCore/QMetaType> in 004ebf8d and then to expect that Qt macros would still work, given that I don't use QObject. In my defense I can only say that with Qt 6 it still compiled.
2021-07-18Revert previous commitAlexey Rusakov
Q_DECLARE_METATYPE is really unhappy about types without a public default constructor.
2021-07-18Make EventContent::TypedBase() constructor protectedAlexey Rusakov
TypedBase is an abstract class; constructing it doesn't make sense. But even if it were not abstract, it's not supposed to be instantiated.
2021-07-18Room::postFile(): adjust to the changed RoomMessageEvent APIAlexey Rusakov
9a5fa623 dropped one of RoomMessageEvent constructors for Qt 6 in order to address #483 - breaking the build with Qt 6 along the way, as Room::postFile() relied on that constructor. This commit changes Room::postFile() in turn, deprecating the current signature and adding a new one that accepts an EventContent object rather than a path to a file. In order to achieve that, FileInfo and ImageInfo classes have gained new constructors that accept QFileInfo instead of the legacy series of parameters, streamlining usage of EventContent structures.
2021-07-16User::rename(): don't discard the current stateAlexey Rusakov
Closes #481.
2021-07-16SyncData::parseJson(): minor optimisationAlexey Rusakov
2021-07-16Log thumbnail requests in their own categoryAlexey Rusakov
As pointed out by one of users, thumbnail requests produce quite a bit of logging traffic, so it's better to manage them separately.
2021-07-16UriResolver: fix clang-tidy warningsAlexey Rusakov