Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This introduces a new API to count unread events that would allow to
obtain those unread and highlight counts since either the fully read
marker (Room::partiallyReadStats) or the last read receipt
(Room::unreadStats). Element uses the read receipt as the anchor
to count unread numbers, while Quaternion historically used the fully
read marker for that (with the pre-0.7 library sticking the two markers
to each other). From now on the meaning of "unread" in Quotient is
aligned with that of the spec and Element, and "partially read" means
events between the fully read marker and the local read receipt;
the design allows client authors to use either or both counting
strategies as they see fit. Respectively, Room::P::setFullyReadMarker()
updates partially-read statistics, while Room::P::setLastReadReceipt(),
when called on a local user, updates unread statistics.
Room::notificationCount() and Room::highlightCount() maintain their
previous meaning as the counters since the last read receipt;
Room::notificationCount() counts unread events locally, falling back
to the value from the above-mentioned key defined by MSC2654, and if
that is not there, further to `unread_notifications/notification_count`
defined in the current spec. Room::highlightCount(), however, is still
taken from the homeserver, not from Room::unreadStats().highlightCount.
|
|
This makes updating display name and emission of necessary signals
including Room::changed() more systematic when it has to occur outside
of updateData() flow - e.g. when loading all members.
|
|
Since MSC2654's unread count is counted from the m.read receipt, and
the course is to follow the spec's terminology and use "unread count"
for the number of notable events since m.read, this required to move
the existing number of notable events since m.fully_read to another
field, henceforth called partiallyReadCount. At the same time,
SyncData::notificationCount is dropped completely since MSC2654 claims
to supersede it.
Also: Room::resetNotificationCount() and Room::resetHighlightCount() are
deprecated, as these never worked properly overwriting values that can
be calculated or sourced from the server, only for these values to be
set back again the next time the room is updated from /sync.
|
|
Room::isEventNotable has been moved out from Room::Private and made
compliant with MSC2654.
The concept of Room::checkForNotifications is taken from Quaternion
where a method with the same name has been in QuaternionRoom for a long
time - however, actual body is a stub for now, always returning
{ Notification::None } (Quaternion's implementation is too crude to be
taken to the library). Now we really need a pushrules processor to fill
this method with something reasonably good. Internally the library now
calls checkForNotifications() on every event added to the timeline,
filling up the events-to-notifications map because it is anticipated
that calculation of notifications can be rather resource-intensive and
should only be done once for a given event.
Finally, Room::notificationsFor is an accessor into the mentioned map,
standing next to isEventNotable (but unlike isEventNotable, it's not
virtual; checkForNotifications is).
|
|
[skip ci]
|
|
|
|
By default enum class values are logged along with the qualifier; this
may or may not be desirable in a given setting. For JoinState(s) and
Membership(Mask) operator<< was overloaded to implicitly suppress
qualification; however, this is both overly sweeping and uses Qt's
internal API for the backend.
Instead, a new QDebug manipulator, terse(), is introduced, that does
the same as those operator<< overloads but on a per-invocation basis.
This makes it slightly more verbose to log enums but makes the QDebug
reconfiguration explicit and doesn't require to produce new overloads
every time a new enum ends up in logs. And it's built entirely on
the published Qt API, reusing the QDebugManip framework that Quotient
already has.
Also: operator<<(QDebug, QDebugManip) has been moved out of
the namespace to fix lookup issues when there's no prior
`using namespace Quotient`.
|
|
This enumeration sees very limited (if any) use outside Quotient; and
though this change will surely break code using it the fix is very
straightforward and quick.
|
|
|
|
|
|
# Conflicts:
# lib/room.cpp
|
|
To simplify retrieval of the local m.read receipt and the marker for it.
|
|
[skip ci]
|
|
This reduces the surface interacting with the User class that eventually
will be split into LocalUser (most part) and RoomMember (a tiny wrapper
around the member data in a given room, used almost everywhere in Room
where User currently is).
Also: dropped a log message when the new receipt is at or behind
the old one as it causes a lot of noise in the logs.
|
|
Port away from implicit 'this' captures in lambdas
|
|
Deprecated with C++20
|
|
|
|
Makes the Room::P::toJson() code more readable.
|
|
|
|
It didn't like using QT_IGNORE_DEPRECATIONS inside a statement.
|
|
|
|
|
|
|
|
A handy macro that introduces an enumerator with a respective
Q_DECL_DEPRECATED_X recommending the substitution.
|
|
These usually don't affect the room outlooks in the room list in any
way; so can be merged into OtherChange instead.
Also: OtherChanges synonym has been added, implying that there might
be more than one change behind a single "Other" flag.
|
|
|
|
DISABLE_MOVE is no more; instead, the library provides Q_DISABLE_MOVE
(and also Q_DISABLE_COPY_MOVE while at it) for Qt pre-5.13 that don't
have it yet. Same for QT_IGNORE_DEPRECATIONS - it only arrived in 5.15
but all the building pieces existed prior so libQuotient has it
regardless of the Qt version used for building.
|
|
It is useful to be able to get all of the state events that have
occured in a room, instead of needing to use Room::getCurrentState,
which filters based on the event type and state key.
|
|
Keep the reply when replacing an event
|
|
|
|
Checking whether any login flows are available is a good enough measure
of the homeserver actual workability. Closes #515.
|
|
|
|
See also https://bugreports.qt.io/browse/QTBUG-82295.
|
|
Just for completeness, not really needed anywhere yet.
|
|
Closes #514.
|
|
|
|
This fixes the `q->readMarker() != historyEdge()` assertion failure
occuring in recalculateUnreadCount() when new events from sync arrive
to a room with no read marker and all history loaded.
|
|
|
|
|
|
|
|
|
|
- BaseJob::prepareError() slightly updated to get the current status
instead of checking the returned value outside in gotReply()
- BaseJob::gotReply() no more reports on 429 Too Many Requests twice
(the first time with dubious "Too Many Requests: Unknown error")
|
|
|
|
|
|
|
|
This is meant to spare clients from having to percent-encode
room aliases, v3 event ids etc. that happen to hit the endpoint path.
It is unfair to expect clients to do that since they are not supposed
to care about the shape of CS API, which parameter should be encoded
in which way. The trick (together with the slightly updated GTAD
configuration) is to percent-encode parts that happen to be QStrings
and not `const char[]`'s while passing all constant parts as plain
C character literals. This also allows to make it more certain that
the path is correctly encoded by passing and storing QByteArray's
wherever the path is already encoded, and only use QStrings (next to
const char arrays) before that.
Since the change alters the API contract (even if that contract was
crappy), some crude detection of percent-encoded stuff on input is
inserted; if input is already percent-encoded, a warning is put to
the logs, alerting developers about the change.
|
|
Qt 6 has Qt::SingleShotConnection; connectSingleShot remains just for
the sake of compatibility across Qt 5 and Qt 6. If you target Qt 6 only,
feel free to use the Qt facility directly.
|