Giter VIP home page Giter VIP logo

libquotient's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libquotient's Issues

Support message events highlighting

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.

Keeping a pointer to an actual member event in the members map

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.

Supply device_id on login

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_names; libqmatrixclient will have to merely pass those to PasswordLogin job without further processing.

HTTP proxy support

As of now, HTTP proxies are completely unsupported in the library, which locks out people behind those.

Create and register one-time keys

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.

cmake no 'install' target

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'

Connection (and cross-connection room) management

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:

  • There's a dubious distinction between 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.
  • A logged out connection lives for a very short time and its status in general is unclear. In theory the libqmatrixclient code could support relogin in such case (and there's a 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.
  • There's quite a bit of connection orchestration code that now resides in 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.

Extend support of m.room.encryption events

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.

Manage event content as a separate object for most if not all events

This is needed for two things:

  • E2EE deals specifically with event content, not with the whole event
  • State changes such as user name/avatar changes can only be detected by looking at the previous content mentioned in the event, which means that the same group of fields is used twice - the first time as the current content, the second time as the previous content; see also #41

Workaround Qt losing connectivity

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.

Introduce automatic tests

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:

  • supports GUI testing and QML (though it's not quite important for libqmatrixclient as of yet)
  • native to Qt, no extra deps or repos; integrates into Qt Creator and KDevelop
  • embedded cross-platform benchmarking appliance

QtTest cons:

  • xUnit-styled splitting of the test suite into functions makes the whole thing less flexible
  • more keystrokes per test
  • doesn't have embedded integration into CI (other than logging to console and returning non-zero from the testing-process)

Catch pros:

  • allows considerably more concise and flexible test code thanks to SECTIONs
  • integrates into CLion and in general is more integrable thanks to the JUnit reporter.
  • though it's an external dependency, in fact it's an advantage in this particular case since the release cycle of Catch is shorter than that of QtTest, and the provided latest-version-fetching code for CMake in the documentation almost entirely removes inconvenience of having another git submodule

Catch cons:

  • single-header is a biggie; even though Catch mitigates this by clever #ifdefs, it's still a biggie
  • no embedded support for GUI testing and (maybe?) Qt-related concepts
    • this one is dubious for now, since libqmatrixclient is and will be intentionally GUI-less
    • note about Qt signals: detecting a signal in fact boils down to connect()ing a lambda to it, which is not a big deal
  • no way to intercept failed assertions (because everything is executed in a single process)

Add qmake toolchain to CI

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).

@room notifications

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.

Support receiving to_device messages

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).

Handling m.room.encrypted events

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).

Missing Declaration

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.

Getting room keys

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.

Setting Roomtopic

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.

Document all public API

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).

connectionError() should not bring LoginDialog

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/verifying devices

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.

Upload device public keys

Fxrh has done some initial work on that; the first thing before we can do anything with actual E2EE is this one.

Port libolm to all the three platforms

This is not exactly about libqmatrixclient, but libqmatrixclient depends on libolm being cross-platform. Things to do (with notes on CI backing):

  • Check libolm building on Linux platforms supported by libqmatrixclient (GCC 4.9-5.3, Clang 3.8, Qt 5.2.1-5.9) - Travis CI
  • Make libolm build with MinGW-w64 on Windows - no CI backing but it's my development platform :)
  • Make libolm build on MacOS (not the Objective-C bindings but the library itself) - Travis CI
  • Make libolm build with Visual Studio 2015 on Windows - AppVeyor CI

Licensing question

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

user::avatar() has a memory leak

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.

Timeline should follow /sync result order, not origin_server_ts

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.

Room events visualisation support

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.