Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds (raw) support for multiple accounts. It basically has 3 parts:
Connection
fromRoom
.Connection
and make some code more defensive so that I don't need to take care of deleted connections too much inMainWindow
.Connection
pointer with a container, rewire connections adding/dropping and modifyRoomListModel
so that it can show rooms from several accounts as well as delete rooms from no more available connections.The provided UI and functionality are as follows:
setConnection()
calls.If you just want to try/review multiple accounts feature and do not plan to further contribute, you can stop reading at this point.
Things to do/discuss further with libqmatrixclient and Q around this functionality (and adventurous minds can already fork this branch and make a "PR to PR"; discussions in #quaternion are also more than welcome):
loginError
andloggedOut
signals inConnection
. In realityloginError
is emitted in cases where something terribly bad goes on with user's access - such asAuthenticationRequired
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, emittingConnection::loggedOut
may be followed bydeleteLater()
right in theConnection
code.MainWindow
but is very well worth putting in the library. There's a rationale for aQMatrixClient::ConnectionManager
class. A similarRoomManager
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.RoomListModel
, apparently needs to be converted to a tree. This is needed at least to select them by account, and also to make use of room tags. There's quite a bit of interesting work on the backend here; one will have to masterQAbstractTreeModel
.account_data
parsed fromsync()
, this makes sense so far, but in the future account settings should be extended with more centralised login experience (see the most recent GNOME for a possible example, and KDE, I guess, has a similar thing), editing per-account things like personal userpic/avatar and "remember me" flag, etc. A big piece of work, mostly on the UI.