mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-11 17:33:46 +01:00
Nicer API
This commit is contained in:
parent
8b6ffc2fb1
commit
e6c3f7c77b
@ -125,7 +125,13 @@ data class CreateRoomParams(
|
||||
* the encryption will be enabled on the created room
|
||||
*/
|
||||
@Transient
|
||||
var enableEncryptionIfInvitedUsersSupportIt: Boolean = false
|
||||
internal var enableEncryptionIfInvitedUsersSupportIt: Boolean = false
|
||||
private set
|
||||
|
||||
fun enableEncryptionIfInvitedUsersSupportIt(): CreateRoomParams {
|
||||
enableEncryptionIfInvitedUsersSupportIt = true
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the crypto algorithm to the room creation parameters.
|
||||
|
@ -96,7 +96,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted
|
||||
invitedUserIds = currentState.selectedUsers.map { it.userId }
|
||||
)
|
||||
.setDirectMessage()
|
||||
.also { it.enableEncryptionIfInvitedUsersSupportIt = true }
|
||||
.enableEncryptionIfInvitedUsersSupportIt()
|
||||
|
||||
session.rx()
|
||||
.createRoom(roomParams)
|
||||
|
@ -131,7 +131,7 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini
|
||||
invitedUserIds = listOf(otherUserId)
|
||||
)
|
||||
.setDirectMessage()
|
||||
.also { it.enableEncryptionIfInvitedUsersSupportIt = true }
|
||||
.enableEncryptionIfInvitedUsersSupportIt()
|
||||
|
||||
session.createRoom(roomParams, object : MatrixCallback<String> {
|
||||
override fun onSuccess(data: String) {
|
||||
|
Loading…
Reference in New Issue
Block a user