Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inviting, kicking and dealing with rooms in Invite state #83

Merged
merged 9 commits into from
Sep 21, 2017

Conversation

KitsuneRal
Copy link
Member

@KitsuneRal KitsuneRal commented Sep 15, 2017

This PR provides necessary plumbing in Connection so that it could process and advertise all things around inviting, as well as room state changes from Invite to Join or Leave (the spec is a bit quirky on that, see the comment on invite_state for /sync). This is also the first PR to introduce jobs that are automatically generated from the Matrix CS API spec (so far they are as simple as InviteJob and KickJob).

Partially addresses #38
Closes #33

A cherry-pick from the kitsune-apigen branch; a family of toJson() and fromJson<>() functions to unify conversion of data back and forth.
Actual usage will come with the next commit.
Kicking and inviting use generated job classes. Rooms in Invite state are stored separately in the hash from those in Join/Leave state because The Spec says so. For clients, this means that the same room may appear twice in the rooms map if it's been left and then the user was again invited to it. The code in Quaternion that properly processes this will arrive shortly.
@KitsuneRal
Copy link
Member Author

GitHub apparently has a bug calculating the difference between files - changes in user.cpp are already in master.

joinedRoom() and leftRoom() now pass the preempted Invite state of the
room as well; roomMap() only returns Invite and Join rooms, not Leave.
…itions

Notably:
* setJoinState() invocation has been missing from the previous code
* processing invites did not take into account that a Leave state may already exist, thereby forcing clients that display left rooms to look through their records just in case they have to replace a Leave with Invite.
* joinedRoom() was emitted even when the room is not newly joined.
@KitsuneRal
Copy link
Member Author

Partially overwrote the branch to get rid of the irrelevant MediaThumbnailJob part. Also, the last commit fixes issues with some transitions not actually happening (e.g. you couldn't join a room previously left, and also there were troubles with inviting over left rooms). I also tried to more carefully and comprehensibly enumerate all possible transitions in Connection::provideRoom() - looks like this is a great case to introduce Catch into libqmatrixclient one day...

@KitsuneRal
Copy link
Member Author

With not much activity around, I think I'll expedite things a little and merge one day earlier.

@KitsuneRal KitsuneRal merged commit 4eeecd2 into master Sep 21, 2017
@KitsuneRal KitsuneRal deleted the kitsune-invite-kick branch September 21, 2017 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Version 0.1 - Released
Development

Successfully merging this pull request may close these issues.

1 participant