Backgroundโ
Inviting someone to a Quiri is a core experience in the quiri app. This guide studies the matrix invite functionality as well as how the Dart SDK implements it (with references to how Fluffychat does it.) See User Discovery in Quiri for a discussion of user discoverability and maintaining a contact list.
Accepting an Inviteโ
Lets see how Fluffychat does it.
It appears that when you are invited to a room, you will be added to the room but with a membership status of invite
. The SDK calls the join room endpoint. Fluffychat is then SDK's client.waitForRoomInSync
method to wait for that room to be enabled
after the room join event is added to the event graph.
TODO:
- how do you list rooms that you have been invited to?
Listening for Invitesโ
The SDK offers the waitForRoomInSync method that waits for a specific room by ID to experience an invite
, join
or leave
event. For private rooms I don't imagine that you would know the id of the room to be able to listen for it in this way. I haven't figured out how Fluffychat handles room invites but based on the waitForRoomInSync
method I am watching the onSync
stream, filtering on room events.