quotient-im / libquotient Goto Github PK
View Code? Open in Web Editor NEWA Qt library to write cross-platform clients for Matrix
Home Page: https://quotient-im.github.io/libQuotient/
License: GNU Lesser General Public License v2.1
A Qt library to write cross-platform clients for Matrix
Home Page: https://quotient-im.github.io/libQuotient/
License: GNU Lesser General Public License v2.1
QtInfoMsg is not available in qt 5.4 it should be 5.5
As reported earlier in the channel, sometimes I get room invites (usually from ChanServ
or NickServ
on the freenode IRC bridge) which trigger an ASSERT in event.cpp : 53
when checking that timestamp is a double.
Example: https://hastebin.com/wefekeputi.js
The relevant code is already in Quaternion (see Message
to start with); it only takes to pick the backend part of it and move to QMatrixClient::TimelineItem
.
As described in the implementation guide, the device list should be loaded for the new member. Approving/blocking devices is another issue.
Right now Room:membersMap
only stores member display names; it might be more useful to store pointers to actual member events since we have them anyway. This will both economise on memory and enable nice use cases like caching and probably even a kind of "state time-machine" which I've been ranting about for, like, a year by now.
This is a basic prerequisite to doing anything useful on E2EE. Right now libqmatrixclient doesn't support passing the device id at all. Clients will have to separately support providing meaningful initial_device_name
s; libqmatrixclient will have to merely pass those to PasswordLogin
job without further processing.
As of now, HTTP proxies are completely unsupported in the library, which locks out people behind those.
It's basically the same call as for the device public keys but with a different set of keys. Once we have device keys uploading, this one should be fairly straightforward.
So that this device could be included into Megolm sessions. Needs #94.
initialsync is deprecated and should be deleted from the library.
Hi,
I tried to build and package this as a shared library for openSUSE.
cmake install
failed with make install -C build has no target 'install'
Now that Quaternion gains multiple accounts support, a need arises to have a ConnectionManager
singleton that would create, keep, and delete Connection
objects. This same singleton would own a NetworkAccessManager
instance; but more importantly, it could notify clients what happens to connections without re-connecting to a new object every time a new Connection
is made.
In addition, here come a few words from quotient-im/Quaternion#155:
loginError
and loggedOut
signals in Connection
. In reality loginError
is emitted in cases where something terribly bad goes on with user's access - such as AuthenticationRequired response returned from a /sync
REST call. I suppose we have to merge these into one signal.reconnect()
method that does exactly that) - however, Quaternion simply disposes of logged out connections as soon as it detects them. Given that logout (as well as login error, see the previous question) basically mean that the password is not (or no more) effectual, seems that this is the only reasonable way to deal with such connections. If that's the case, emitting Connection::loggedOut
may be followed by deleteLater() right in the Connection
code.MainWindow
but is very well worth putting in the library. There's a rationale for a QMatrixClient::ConnectionManager
class. A similar RoomManager
class would also be very nice to have and could serve as a library base for the room list model, or even the model itself.In order to properly rotate Megolm sessions, the library should detect and store rotation criteria that arrive in m.room.encryption
events: rotation_period_msgs
and rotation_period_ms
.
Now that we (almost, as of the moment of this writing) have events creation and sending, local echo support boils down to storing the created-and-sent events in Room
and exposing them to clients so that they could visualise them.
See also: https://matrix.org/speculator/spec/HEAD/client_server/unstable.html#local-echo
There is no logout method as specfied in https://matrix.org/docs/api/client-server/#!/Session_management/post_matrix_client_r0_logout
This is needed for two things:
On poorer networks (cellular, some WiFi), QNAM tends to lose connectivity and not recover back - even if the network is actually there. Apparently, libqmatrixclient has to step in and somehow recover (recreate QNAM? reset its state?) instead.
All jobs e.g. joinedRoom
should be fired when the job succeeds
or more general returns
not when started (When i do a refresh of the GUI uMatriks the room is not yet removed). Should centralize result
&& individual job events
? See https://github.com/QMatrixClient/libqmatrixclient/blob/master/jobs/basejob.cpp#L255
I also need this for leftRoom
signal (not yet pushed).
And we should also be able to show the error from a job aka "room does not exist"
It's essential for a library to have tests, so let's get them already. Aside from the obvious QtTest option, a single-header Catch is in fashion these days, so I took time to dive in both. If anybody wants to throw something else, please do (preferably with pros and cons as below).
QtTest pros:
QtTest cons:
Catch pros:
Catch cons:
See https://github.com/QMatrixClient/libqmatrixclient/projects/2 for the backlog
libqmatrixclient.pri
is hopelessly behind CMakeLists.txt
every time the list of source files is changed. To alleviate that, at least qmake toolchain should be triggered in Travis CI, so that we at least know that things built. And qmc-example.pro should be the entry point (until we get a proper autotest harness, that is).
So that at least it's clear that a room is not mindlessly garbled but rather encrypted
While a naïve implementation would be dead simple (just add @room to the highlight-setting logic mentioned in #106), the proper implementation should follow the spec and Synapse/Riot behaviour described in the respective Google Doc. This implies dependency on #36 in the part of power_levels
.
Missing:
To-device messages are not usual "chat" messages; in fact, they are not even room events. Treating them looks closer to treating ephemeral events. This is necessary for sending encrypted messages (because m.room_key
events are to-device - see #90).
This poses an immediate security threat when somebody sends a piece of logs to somebody else without sanitising it (and most wont sanitise).
A necessary step in order to share the Megolm session keys with other users. Needs a POST to /_matrix/client/unstable/keys/query
.
Minimal exit criterion: at least some events are correctly decrypted and displayed in Quaternion. Full exit criterion: decrypting a message event is added to qmc-example
(note that this will require one more test room that will be encrypted).
Prerequisite: sharing the keys with other devices in the room (as per #92), ability to send to-device messages.
Hi,
I tried to package this as a shard library and got the following output in my build log. The build succeeded (I circumvented #113), this is the output that contains the error.
'QDebug QMatrixClient::operator<<(QDebug, const QMatrixClient::BaseJob::Status&)' has not been declared within QMatrixClient
[ 35s] QDebug QMatrixClient::operator<<(QDebug dbg, const BaseJob::Status& s)
[ 35s] ^~~~~~~~~~~~~
[ 35s] In file included from /home/abuild/rpmbuild/BUILD/libqmatrixclient-0.1/jobs/basejob.cpp:19:0:
[ 35s] /home/abuild/rpmbuild/BUILD/libqmatrixclient-0.1/jobs/basejob.h:113:35: note: only here as a friend
[ 35s] friend QDebug operator<<(QDebug dbg, const Status& s);
[ 35s] ^~~~~~~~
I can provide a longer log if that helps you.
This means processing m.room_key
events. They arrive in the to_device
section of /sync
return, so the pre-requisite for this is ability to receive to-device messages.
I am adding this featurerequests, because I would be more than happy, to implement them in the UI, but don’t really know about the lib yet.
Without this, adoption of libqmatrixclient boils down to reusing parts of Tensor/Quaternion, which is not always the best way (especially for special-purpose cases).
We should only show a login dialog in cases when we're certain there's a problem with access_token. Right now it is shown on any error from PasswordLogin job, which in turn is invoked every time when SyncJob has problems (by means of Connection::reconnect()
).
Speaking of Connection::reconnect()
, I wonder if it even should exist in its current form. Storing a password even in memory is not a very good thing. The protocol mandates usage of refresh_tokens to get a new access_token - probably that's what is supposed to be in there. And even that should only be used in case when access_token becomes invalid, not for all cases of access denial.
Blocking is more important because it is supposed to effectively ban devices from conversation, while verifying "merely" allows to decorate that certain messages come from an actually verified source.
Fxrh has done some initial work on that; the first thing before we can do anything with actual E2EE is this one.
This is not exactly about libqmatrixclient, but libqmatrixclient depends on libolm being cross-platform. Things to do (with notes on CI backing):
Necessary to create a Megolm session (#93).
Hi,
first of all, many thanks for all the work that is put into this library. I am watching libqmatrixclient
for a while and it is really great to see all this progress!
I am thinking about using the library in one of my iOs apps. But unfortunately it seems like the current license isn't really suitable for iOs, as the apple app store doesn't allow libraries to be dynamically linked. So I wanted to ask if there is any chance to change the license to something that can be better used together with iOs. Maybe MIT or Apache 2.0?
Many thanks for your time!
Have a nice day,
Bernhard
the user::avatar() method has this scaledAvatar cache list. And everytime we don’t have a scaledAvatar for the given size we generate a new one. Becauso auf KeepAspectRatio, the new avatar will not have the requested size, so we will calculate a new one everytime and the list gets longer and longer.
Upon yesterday's discussion in #quaternion and #matrix-dev, the current way of forming the timeline in Quaternion turned out to be utterly wrong: origin_server_ts should not be used to order a timeline (counter-example: one homeserver with skewed clock, and you see mess in the timeline, no matter which homeserver you're looking at it through).
As there's no "correct" full order (DAG is partially ordered by definition), the best option is to follow the order in which /sync and /messages provide results. A corollary of this is that we cannot notify clients about each newMessage separately; and moreover, notifying about an arrived block of messages should include information about ordering of these message inside the timeline. The interface and rationale for that is actually a big question in itself.
So that this user could not decrypt subsequent messages even if he re-joins the room.
Events that don't have state_key should not be treated as state events - now they are.
Quaternion and Tensor now have very similar (since Tensor borrowed it from Quaternion sometime ago) code to produce some representation of any RoomEvent
. At least parts of this should go to the library. The complication here is that since this code should allow very limited displaying capabilities (think CLI) as well as rich HTML or QML display. Since we don't want to deal with alternative ways to represent events, apparently, the library should have a kind of toString() operation and/or a Q_PROPERTY with possibly-overloadable (?) list of strings matching specific events (for the case when somebody prefers to provide his/her own list of strings). I'm talking about strings like "%1 entered the room". Opinions are welcome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.