Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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
|
|
|
|
|
|
|
|
Use originTimestamp(); the corresponding Q_PROPERTY was not renamed
(in error) so it is now.
|
|
Access tokens should be stored with Qt Keychain that's about to come;
and these methods were deprecated since before 0.5.
|
|
This still works with older moc yet produces actual warnings when
compiling C++ code.
|
|
BaseJob: StatusCode::JsonParseError
Connection: resolved() and reconnected() signals; roomMap(); postReceipt()
User: bridged() and rawName()
ConnectionData: setHost() and setPort()
StateEventBase: prev_content()
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
Use QUrl in CS API backend
|
|
Closes #489.
|
|
Read receipts are entangled with counting unread messages, and saving
them also helps in not sending receipts for too old events. Other users'
read receipts are still treated as truly ephemeral.
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
BaseJob::loadFromJson() does just fine without QStringViews.
[skip ci]
|
|
See 000b5730.
|
|
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.
|
|
|
|
hasUnreadMessages is derived from unreadCount; isFavourite/isLowPriority
effectively depend on tagNames.
|
|
[skip ci]
|
|
|
|
|
|
It's now possible to get receipts along with their timestamps by calling
Room::lastReadReceipt(). Together this new method, fullyReadMarker(),
and lastFullyReadEventId() deprecate readMarker() overloads and
readMarkerEventId() respectively.
lastFullyReadEventId is also a Q_PROPERTY (deprecating
readMarkerEventId); readMarkerMoved() signal is deprecated by
fullyReadMarkerMoved(), while readMarkerForUserMoved() is deprecated
in favour of existing lastReadEventChanged().
|
|
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().
|
|
|
|
Namely memberCount(), localAliases(), remoteAliases(), timelineEdge().
|
|
|
|
This turns the design changes laid out in #464 comments to code, as of
0.6.x branch (0.7 API will be introduced separately):
- readMarker() now returns the fully read marker, unlike
readMarker(User*) that returns a read receipt, even when called for
the local user.
- Private::setLastReadEvent() -> setLastReadReceipt(), incorporating
the "promotion" logic from promoteReadReceipt().
- The above makes promoteReadReceipt() unneeded; the remaining piece
of logic that recalculates the number of unread messages is put to
its own method - Private::recalculateUnreadCount().
- Private::updateUnreadCount() is only slightly refreshed, continues
to use the fully read marker position (as it used to).
- Now that read receipts and fully read markers are managed separately,
Private::setLastReadReceipt() has got its counterpart,
Private::setFullyReadMarker(); both only update their respective
markers locally (emitting signals as needed), without interaction
with the homeserver.
- Private::markMessagesAsRead() now delegates updating the fully read
marker to setFullyReadMarker() and on top of that sends the new
fully read marker to the homeserver.
- Private::serverReadMarker -> fullyReadUntilEventId (to be really clear
what it stores).
- The hand-written PostReadMarkersJob is replaced with the generated
SetReadMarkerJob that does the same thing (and can update the read
receipt on top).
|
|
The minor component is now updated in .cpp, not in .h.
|
|
While slightly more complex for updating, this allows COW to kick in in
the read accessor; using QSet instead of QList also provides better
consistency guarantees. For QML both are converted to an Array-like
collection since Qt 5.15; Qt 5.12 turns QSet<> in a QVariantList,
according to the documentation, which is quite reasonable too.
|
|
|
|
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.
|
|
|
|
|
|
Without this, it compiles on Linux but on macOS and Windows.
|
|
|
|
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.
|
|
|
|
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.
|
|
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.
|