Accepting and declining invites
Hook up accept and decline buttons in the invites UI. Accept will attempt to accept and then navigate to the room; decline shows a confirmation dialog. Fixes #106
This commit is contained in:
parent
114e9725fa
commit
ff5672597a
26 changed files with 582 additions and 77 deletions
|
|
@ -33,7 +33,7 @@ class RoomSummaryDetailsFactory(private val roomMessageFactory: RoomMessageFacto
|
|||
roomId = RoomId(slidingSyncRoom.roomId()),
|
||||
name = slidingSyncRoom.name() ?: slidingSyncRoom.roomId(),
|
||||
canonicalAlias = room?.canonicalAlias(),
|
||||
isDirect = slidingSyncRoom.isDm() ?: false,
|
||||
isDirect = room?.isDirect() ?: false,
|
||||
avatarURLString = room?.avatarUrl(),
|
||||
unreadNotificationCount = slidingSyncRoom.unreadNotifications().use { it.notificationCount().toInt() },
|
||||
lastMessage = latestRoomMessage,
|
||||
|
|
|
|||
|
|
@ -206,4 +206,17 @@ class RustMatrixRoom(
|
|||
innerRoom.leave()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun acceptInvitation(): Result<Unit> = withContext(coroutineDispatchers.io) {
|
||||
kotlin.runCatching {
|
||||
innerRoom.acceptInvitation()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun rejectInvitation(): Result<Unit> = withContext(coroutineDispatchers.io) {
|
||||
kotlin.runCatching {
|
||||
innerRoom.rejectInvitation()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue