Fix not being able to decline an invite from the room list (#3466)
* Add `InvitedRoom` to wrap Rust SDK Rooms in 'invited' membership state. At the moment, this is a wrapper that allows us to call `Room.leave()` without having to initialise the room's timeline (which is impossible). * Add `MatrixRoom.getInvitedRoom(roomId)` to get one of these rooms. Also, `RustRoomFactory` now has a `createInvitedRoom` method for this. * Adapt `AcceptDeclineInvitePresenter` to use the new APIs.
This commit is contained in:
parent
764692b90b
commit
7238af7f7f
9 changed files with 122 additions and 15 deletions
|
|
@ -112,8 +112,8 @@ class AcceptDeclineInvitePresenter @Inject constructor(
|
|||
|
||||
private fun CoroutineScope.declineInvite(roomId: RoomId, declinedAction: MutableState<AsyncAction<RoomId>>) = launch {
|
||||
suspend {
|
||||
client.getRoom(roomId)?.use {
|
||||
it.leave().getOrThrow()
|
||||
client.getInvitedRoom(roomId)?.use {
|
||||
it.declineInvite().getOrThrow()
|
||||
notificationCleaner.clearMembershipNotificationForRoom(client.sessionId, roomId)
|
||||
}
|
||||
roomId
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue