Age | Commit message (Collapse) | Author |
|
Closes #412.
|
|
The first character inside the fragment should be /
|
|
|
|
May lead to new crashes due to nullptr returned from Connection::user()
on more utterly invalid content from the wire that the library still
doesn't properly invalidate. This has long been quite a good case for
exceptions, or another error-handling framework: Connection::user() can
return nullptr either when out of memory or when the id is invalid or
empty, and other places are likely to treat invalid ids in different
ways but probably just hope that memory exhaustion "never happens", or
try to handle it in a quite different way than an empty or invalid id.
Something to think of in 0.7.
|
|
|
|
See https://github.com/matrix-org/matrix-doc/issues/2717
|
|
|
|
|
|
...instead of a complicated explicit code converting from JSON
to varianthash to hash.
|
|
As of 0.6.1, User::name() triggers fetching the user profile (whether
this is right is a separate question but that's the way it works with
the current library API) - displayname() should use it rather than
shortcut to d->defaultName to get results consistent with User::name().
|
|
This is a temporary workaround for
https://github.com/matrix-org/synapse/issues/8029 - note that
regenerating CS API code will lead to overwriting this. The proper fix
should be done in matrix-doc (see
https://github.com/matrix-org/matrix-doc/issues/2717).
|
|
Qt 5.15 deprecates bearer management.
|
|
|
|
5849686e introduced a new way of storing user avatars and names -
unfortunately it didn't fully cover the case of the user's default
(profile) name and avatar. This commit fixes it; in 0.6.x branch,
the fix requires a const_cast<> hack since name() and avatarObject()
invocations are used as triggers to fetch the profile. 0.7 will have
User::fetchProfile() method instead.
|
|
The most frequent occurence of IncorrectResponse so far is a proxy/CDN
failure. This is not a grave error; there's a chance that the retry will
succeed. In the worst case the job will fail after 3 identical errors
(except SyncJob that will try to get through forever - but SyncJob
failures should still be indicated in the client's UI in some
non-intrusive way).
|
|
|
|
|
|
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 commit c69f100e 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 - this will be
fixed in 0.7 by introducing a special class for a user profile.
|
|
|
|
|
|
|
|
|
|
User::updateName() usually operates on a specific room; setting an
object name from an arbitrary (whichever came last at any point in time)
room member event for a given user does not look like a good idea.
And having it in User::updateAvatar() seems to be a copy-paste fallout.
|
|
|
|
Users are always parented to their Connection; there's no need to store
a pointer to the connection on top of the one already stored by QObject.
|
|
Bridge postfixes stopped being a thing long ago; since then, bridged()
has nothing but an empty string, and rawName() coincides with name().
|
|
So that room avatar events could also be sent, not only received.
|
|
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.
|
|
Matrix URIs and resolving them
|
|
|
|
Closes #314.
|
|
|
|
To enable reporting when the action is incorrect.
|
|
|
|
|
|
|
|
Introducing the uniform way to resolve Matrix URIs and identifiers
to Room/User objects, passing an optional event id (if supplied) to
the client-defined handler. Just call ResourceResolver::visitResource()
or ResourceResolver::openResource() and you'll have that string parsed
and dispatched where you need.
|
|
Long run tests over 2+ days kept crashing before this commit but
stopped crashing with pipelining on and HTTP2 off.
|
|
...meaning - errors from it should not throw up at a user, who has no
clue (they still should go to logs for investigation).
|
|
|
|
This reverts commit b1071cf34b86685c3cdb5004d6112881966a7ce6. Passing
-1 to sync() and, respectively, to SyncJob does not add any timeout;
however, careful reading of the spec reveals that the default value
for the timeout (0) means to return as soon as possible, not as late
as possible. As a consequence, syncLoop() without parameters initiates
a sync polling frenzy, with the client sending a new request as soon as
the previous returns, while the server returns the request as soon as
it practically can, not as soon as another event for the client comes
around.
To fix this, the default value for syncLoop() is changed to 30 seconds.
The recently added msecBetween parameter is abolished; we really don't
want to steer people to classic polling from long polling.
|
|
For matrix-doc, specifically, it is master (5cb4b086) merged with
https://github.com/matrix-org/matrix-doc/pull/2518.
|
|
The two main cases for this header file are:
* namespace QMatrixClient = Quotient should occur exactly once,
to respect ODR.
* Q_NAMESPACE for namespace Quotient (to enable Q_ENUM_NS, particularly)
must be defined exactly once, for the same reason.
|
|
|
|
isLoggedIn() is just a wrapper around Connection::accessToken() that
returns whether it's not empty. Now, Connection::accessToken() and
Connection::logout() are changed in such a way that if there's
a logout job ongoing Connection::accessToken() will return an empty
value even though the access token is still stored in ConnectionData.
This gives a hint to the rest of Connection and to the client code
that the user is not quite authenticated anymore. Finally, syncLoop()
and sync() have been altered to check isLoggedIn() before proceeding
with their network request.
|
|
As it's observed now, Synapse responds almost immediately on /sync
requests - even if there are no events to return. This downgrades
long-polling to simply polling, and since clients don't expect it,
polling loops become pretty violent. To alleviate that somehow,
syncLoop now accepts the second parameter, msecBetween (500 msecs
by default), to configure waiting between the previous sync response
and the next sync request. This is only for syncLoop();
Connection::sync() fires instantly, as before.
|
|
|
|
|