Age | Commit message (Collapse) | Author |
|
|
|
Namely memberCount(), localAliases(), remoteAliases(), timelineEdge().
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
(cherry picked from commit 7b65051e959968fe538f40c975d85757cfcc7df7)
(cherry picked from commit 9edfefe9b209583d18ce92e7ffd73e8aa1f3ef1e)
|
|
|
|
See https://www.qt.io/blog/whats-new-in-qmetatype-qvariant#qmetatype-knows-your-properties-and-methods-types
|
|
Maybe it's not even that bad, given that an effort is taken to recover
from the internal member list corruption.
|
|
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.
|
|
|
|
Port existing copyright statement to reuse using licensedigger
|
|
To be very clear what this function checks. See also #437.
|
|
|
|
This removes now-deprecated RoomMemberEvent API usages and also does
a few more things differently from the stable branch. Rather than rely
on prev_content (the way pre-0.7 goes), processStateEvent() now
includes a pre-check for no-op state events (the fix in ff020f3b
turned out to be insufficient for such events and they still caused
the same assertion failure at some point down the line). Now the state
event is only added to currentState and, where relevant, to baseState,
if it actually changes the room state; otherwise, it is ignored for
the purpose of state tracking (even when still added to the timeline,
if it came in the timeline block).
One side-effect of this change is that processStateEvent() now returns
OtherChange instead of NoChange for unknown state events.
At the same time removeMemberFromMap() now has an additional safety net,
making sure that a given user is actually deleted from the map even
if their name is mismatched. This comes at a cost of looking through
the whole hashmap but normally should not occur with the current code
that shaves away no-op state events. We'll only see when some client
starts to actively use 0.7 (quotest doesn't trigger those).
|
|
|
|
|
|
|
|
Also: use a structured binding for better code readability.
(cherry picked from commit 66972c81d018231f08f3767feda4b41ae5e1b8e0)
|
|
(cherry picked from commit 0a2acd750a4155969092be674ed3dd9a71b2354f)
|
|
The change in 39830496 led to prev_content becoming a fallback not only
for displaying user names but also for storing them in the internal
member map, which is really not what was intended.
A lot of debug logging has been added - this will be moved to a new
logging category before merging.
|
|
* QT_NO_URL_CAST_FROM_STRING makes it clearer where QUrls are created
from QStrings (which incurs a parsing cost).
* QT_STRICT_ITERATORS helps detecting where begin()/end() is used
instead of cbegin()/cend(). KDE developers have verified that
the generated assembly code is identical.
|
|
Changes in e81117fb exposed a flaw in EncryptionEvent causing assertion
failure when this event is default-initialised (i.e. no encryption).
|
|
In particular: removed unnecessary #includes, deprecated and no more
used constructs, replaced stored members with dynamic generation
from JSON (TypingEvent and, especially promising for performance,
ReceiptEvent)
|
|
|
|
|
|
|
|
|
|
MemberEventContent: displayname and avatarUrl are now Omittables;
CS API doesn't guarantee their presence (see also
https://github.com/matrix-org/matrix-doc/issues/1375) but Quotient
used to assume they are always there, causing #412.
RoomMemberEvent: displayname() -> newDisplayName() and
avatarUrl() -> newAvatarUrl(), to emphasise the actual semantics (and
also the changed interface). The old signatures still work but are
deprecated.
Instead of roomMembername() (with weird camel-casing), three new
methods in addition to safeMemberName() are introduced to Room:
- memberName() - produces the "best known" display name for a
given member; User::name() uses it to avoid the pitfall of #412.
- disambiguatedMemberName() - this is what roomMembername() used to be;
not recommended for direct use when UI is concerned.
- safeMemberName() - remains as is, with the fix to the documentation
that used to mislead that the function returns HTML-escaped content
(it didn't, and doesn't).
- htmlSafeMemberName() - does what safeMemberName() claimed to do.
Respectively, memberNames() is deprecated in favor of safeMemberNames()
and htmlSafeMemberNames(). The corresponding Q_PROPERTY uses
safeMemberNames() now.
Similar to memberName(), Room has got memberAvatarUrl() to spare
User class from diving into Room state to find the member avatar URL.
Closes #412.
|
|
can be applied.
|
|
|
|
|
|
The current mechanism relied on a complicated and fragile machinery
around setNameForRoom() and setAvatarForRoom() that maintained the
"most used" entity for a given user along with "other" ones. Given that
per-room avatars are pretty rare in Matrix, it's also been inefficient
as kitsune-benchmark-set_ForRoom branch shows. The new mechanism stores
the "default" (as per user profile) name and avatar and maintains
a singleton map of avatar objects across all users. Per-user profile
only (normally) exists for the local user so there's yet another
inefficiency that will be fixed further down the road by introducing
a separate user profile class.
|
|
|
|
Sending them in the foreground causes Quaternion to throw scary
messages when read receipts don't go through while that's actually
not a big deal. Also, network traffic deprioritisation.
|
|
Edits are (normally) applied to some other event up the timeline,
therefore not displayed. Having [1] in unread counts while seeing
nothing in the timeline is quite confusing.
|
|
...meaning - errors from it should not throw up at a user, who has no
clue (they still should go to logs for investigation).
|
|
|
|
Closes #406.
|
|
operator+() is no more wanted with iterators on associative containers.
|
|
|
|
|
|
Pulled from Quaternion code.
|
|
|
|
When a message is redacted it has no sender. If it happens to be
in the bulkhead, Quotient tries to promote a read marker over it and
fails on being unable to resolve the author.
|
|
The method grew large and a bit unwieldy over the years.
|
|
Fixes #394.
|
|
fixing msc2432
|
|
Co-Authored-By: Kitsune Ral <Kitsune-Ral@users.sf.net>
|