Age | Commit message (Collapse) | Author |
|
Remove qtolm git module. Update CMakeLists.txt.
Rename olm to crypto subdir to prevent disambiguation. Rename internal
files accordingly. Comment out not ported E2EE API usage.
|
|
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`.
|
|
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.
|
|
Checking whether any login flows are available is a good enough measure
of the homeserver actual workability. Closes #515.
|
|
|
|
|
|
Clients don't need to do it themselves.
|
|
The query is easier to manipulate; and the original mxc URL is not used
for the real network request anyway.
|
|
BaseJob: StatusCode::JsonParseError
Connection: resolved() and reconnected() signals; roomMap(); postReceipt()
User: bridged() and rawName()
ConnectionData: setHost() and setPort()
StateEventBase: prev_content()
|
|
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.
|
|
erase_if is now also provided by Qt; doing pretty much the same thing,
the Qt implementation only returns the number of removed entries instead
of returning a collection of them, however. Worth admitting at this
point that the function in connection.cpp has never had the semantics
of STL's erase_if() and doesn't quite have the semantics of remove_if()
either; but at least it's closer to remove_if().
|
|
See https://www.qt.io/blog/whats-new-in-qmetatype-qvariant#qmetatype-knows-your-properties-and-methods-types
|
|
This is an adjustment to the earlier fix of #471: if a join is
immediately followed by a leave (e.g. from another client/bot - you
can't do it programmatically from libQuotient) the sync may bring the
room already in the Leave state; therefore `joinRoom` should not
impose the state but rather ask `provideRoom` to create a `Join` room -
just as it's designed when passed an empty `joinState`.
|
|
An alternative implementation of #463 (and thanks to Carl for spotting
the original problem).
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
|
|
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
|
|
See #437 for the discussion.
|
|
To be very clear what this function checks. See also #437.
|
|
So just reset the base URL and return, with no error signals.
(cherry picked from commit be00308ad67286b45912202750fe49fb87f16e4a)
|
|
...because finished() includes abandoning and should only be relevant
when lifecycle issues are involved.
(cherry picked from commit 90d41b697af39253483d9bcca4e57b11d2197112)
|
|
|
|
1. resolveServer() now emits homeserverChanged() even when there's no
.well-known file found.
2. checkAndConnect() entirely removed from the header file.
3. Sunny-day scenario for assumeIdentity() is now asynchronous,
triggering a call to /whoami to double-check the user.
4. LoginFlow aliases is moved out from LoginFlows to Quotient namespace.
|
|
Notably, recommend using loginFlowsChanged() rather than
homeserverChanged() to detect when a Connection object is ready for
a login sequence. Related: #427.
|
|
|
|
(cherry picked from commit 0a2acd750a4155969092be674ed3dd9a71b2354f)
|
|
Part of the fix for #421.
(cherry picked from commit 104356d945671762af23e346f7898a3208770d97)
|
|
|
|
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.
(cherry picked from commit 3c85f049389dec3b0ee6406f0be2cfaf0089f1fe)
|
|
|
|
The Connection object has quite few uses after logging out - neither
rooms nor users under it no more represent actual situation, and the
object cannot be cleanly reused for a new login (also, the use case
for that is pretty dubious). This doesn't cover the case when
the session has been forcibly logged-out by the server (causing
loginError() to be emitted) - in that case re-authentication
is an expected flow.
|
|
|
|
Closes #314.
|
|
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.
|
|
|
|
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.
|
|
|
|
Qt 5.15 deprecates binary JSON format in favour of CBOR now used as
a backend for its JSON classes.
|
|
|
|
No functional changes here.
|
|
This is to prevent the jobs from several
resolveServer() / setHomeserver() invocations running in parallel.
|
|
|
|
connectToServer() is left for compatibility but deprecated.
|
|
The code is really defensive now, making sure there's exactly one slash
between the base path and the endpoint. It's still very conservative
about the path composition otherwise (no normalisation etc.).
|
|
(Mostly) fixes #397. Fixes #398. If there's a need to reparent the job
to some other object, it should now be done after callApi()/run() call
(not that there were many touch points before that moment, anyway).
Collateral damage: job-starting methods are no more const (but that
didn't belong them anyway, too).
|
|
Also: use 4-arg connect() to make sure lambdas are disconnected
if the connection is gone.
|
|
|
|
The method grew large and a bit unwieldy over the years.
|
|
|