Reverts change to when arrow alignment on some classes
This commit is contained in:
parent
1cb14d6be7
commit
4266c330de
@ -73,7 +73,7 @@ internal class SendGossipRequestWorker(context: Context, params: WorkerParameter
|
|||||||
val eventType: String
|
val eventType: String
|
||||||
val requestId: String
|
val requestId: String
|
||||||
when {
|
when {
|
||||||
params.keyShareRequest != null -> {
|
params.keyShareRequest != null -> {
|
||||||
eventType = EventType.ROOM_KEY_REQUEST
|
eventType = EventType.ROOM_KEY_REQUEST
|
||||||
requestId = params.keyShareRequest.requestId
|
requestId = params.keyShareRequest.requestId
|
||||||
val toDeviceContent = RoomKeyShareRequest(
|
val toDeviceContent = RoomKeyShareRequest(
|
||||||
@ -120,7 +120,7 @@ internal class SendGossipRequestWorker(context: Context, params: WorkerParameter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
return buildErrorResult(params, "Unknown empty gossiping request").also {
|
return buildErrorResult(params, "Unknown empty gossiping request").also {
|
||||||
Timber.e("Unknown empty gossiping request: $params")
|
Timber.e("Unknown empty gossiping request: $params")
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ internal class DefaultLegacySessionImporter @Inject constructor(
|
|||||||
bytes = it.bytes,
|
bytes = it.bytes,
|
||||||
hashType = when (it.type) {
|
hashType = when (it.type) {
|
||||||
LegacyFingerprint.HashType.SHA1,
|
LegacyFingerprint.HashType.SHA1,
|
||||||
null -> Fingerprint.HashType.SHA1
|
null -> Fingerprint.HashType.SHA1
|
||||||
LegacyFingerprint.HashType.SHA256 -> Fingerprint.HashType.SHA256
|
LegacyFingerprint.HashType.SHA256 -> Fingerprint.HashType.SHA256
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -60,10 +60,10 @@ internal class DefaultDeactivateAccountTask @Inject constructor(
|
|||||||
execute(params.copy(userAuthParam = authUpdate))
|
execute(params.copy(userAuthParam = authUpdate))
|
||||||
}
|
}
|
||||||
)) {
|
)) {
|
||||||
UiaResult.SUCCESS -> {
|
UiaResult.SUCCESS -> {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
UiaResult.FAILURE -> {
|
UiaResult.FAILURE -> {
|
||||||
Timber.d("## UIA: propagate failure")
|
Timber.d("## UIA: propagate failure")
|
||||||
throw throwable
|
throw throwable
|
||||||
}
|
}
|
||||||
|
@ -165,8 +165,8 @@ internal class DefaultProfileService @Inject constructor(private val taskExecuto
|
|||||||
|
|
||||||
private fun UserThreePidEntity.asDomain(): ThreePid {
|
private fun UserThreePidEntity.asDomain(): ThreePid {
|
||||||
return when (medium) {
|
return when (medium) {
|
||||||
ThirdPartyIdentifier.MEDIUM_EMAIL -> ThreePid.Email(address)
|
ThirdPartyIdentifier.MEDIUM_EMAIL -> ThreePid.Email(address)
|
||||||
ThirdPartyIdentifier.MEDIUM_MSISDN -> ThreePid.Msisdn(address)
|
ThirdPartyIdentifier.MEDIUM_MSISDN -> ThreePid.Msisdn(address)
|
||||||
else -> error("Invalid medium type")
|
else -> error("Invalid medium type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,17 +260,15 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
|
|||||||
|
|
||||||
private fun handleGlobalError(globalError: GlobalError) {
|
private fun handleGlobalError(globalError: GlobalError) {
|
||||||
when (globalError) {
|
when (globalError) {
|
||||||
is GlobalError.InvalidToken ->
|
is GlobalError.InvalidToken ->
|
||||||
handleInvalidToken(globalError)
|
handleInvalidToken(globalError)
|
||||||
is GlobalError.ConsentNotGivenError ->
|
is GlobalError.ConsentNotGivenError ->
|
||||||
consentNotGivenHelper.displayDialog(
|
consentNotGivenHelper.displayDialog(globalError.consentUri,
|
||||||
globalError.consentUri,
|
activeSessionHolder.getActiveSession().sessionParams.homeServerHost ?: "")
|
||||||
activeSessionHolder.getActiveSession().sessionParams.homeServerHost ?: ""
|
is GlobalError.CertificateError ->
|
||||||
)
|
|
||||||
is GlobalError.CertificateError ->
|
|
||||||
handleCertificateError(globalError)
|
handleCertificateError(globalError)
|
||||||
GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration
|
GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration
|
||||||
is GlobalError.InitialSyncRequest -> handleInitialSyncRequest(globalError)
|
is GlobalError.InitialSyncRequest -> handleInitialSyncRequest(globalError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class ContactsBookFragment @Inject constructor(
|
|||||||
.allowBack(useCross = true)
|
.allowBack(useCross = true)
|
||||||
contactsBookViewModel.observeViewEvents {
|
contactsBookViewModel.observeViewEvents {
|
||||||
when (it) {
|
when (it) {
|
||||||
is ContactsBookViewEvents.Failure -> showFailure(it.throwable)
|
is ContactsBookViewEvents.Failure -> showFailure(it.throwable)
|
||||||
is ContactsBookViewEvents.OnPoliciesRetrieved -> showConsentDialog(it)
|
is ContactsBookViewEvents.OnPoliciesRetrieved -> showConsentDialog(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,10 +160,10 @@ class ContactsBookViewModel @AssistedInject constructor(
|
|||||||
|
|
||||||
override fun handle(action: ContactsBookAction) {
|
override fun handle(action: ContactsBookAction) {
|
||||||
when (action) {
|
when (action) {
|
||||||
is ContactsBookAction.FilterWith -> handleFilterWith(action)
|
is ContactsBookAction.FilterWith -> handleFilterWith(action)
|
||||||
is ContactsBookAction.OnlyBoundContacts -> handleOnlyBoundContacts(action)
|
is ContactsBookAction.OnlyBoundContacts -> handleOnlyBoundContacts(action)
|
||||||
ContactsBookAction.UserConsentGranted -> handleUserConsentGranted()
|
ContactsBookAction.UserConsentGranted -> handleUserConsentGranted()
|
||||||
ContactsBookAction.UserConsentRequest -> handleUserConsentRequest()
|
ContactsBookAction.UserConsentRequest -> handleUserConsentRequest()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class KeysBackupRestoreSharedViewModel @Inject constructor(
|
|||||||
val progressObserver = object : StepProgressListener {
|
val progressObserver = object : StepProgressListener {
|
||||||
override fun onStepProgress(step: StepProgressListener.Step) {
|
override fun onStepProgress(step: StepProgressListener.Step) {
|
||||||
when (step) {
|
when (step) {
|
||||||
is StepProgressListener.Step.ComputingKey -> {
|
is StepProgressListener.Step.ComputingKey -> {
|
||||||
loadingEvent.postValue(
|
loadingEvent.postValue(
|
||||||
WaitingViewData(
|
WaitingViewData(
|
||||||
stringProvider.getString(R.string.keys_backup_restoring_waiting_message) +
|
stringProvider.getString(R.string.keys_backup_restoring_waiting_message) +
|
||||||
@ -102,7 +102,7 @@ class KeysBackupRestoreSharedViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is StepProgressListener.Step.ImportingKey -> {
|
is StepProgressListener.Step.ImportingKey -> {
|
||||||
Timber.d("backupKeys.ImportingKey.progress: ${step.progress}")
|
Timber.d("backupKeys.ImportingKey.progress: ${step.progress}")
|
||||||
// Progress 0 can take a while, display an indeterminate progress in this case
|
// Progress 0 can take a while, display an indeterminate progress in this case
|
||||||
if (step.progress == 0) {
|
if (step.progress == 0) {
|
||||||
|
@ -134,13 +134,13 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
|
|||||||
|
|
||||||
override fun handle(action: SharedSecureStorageAction) = withState {
|
override fun handle(action: SharedSecureStorageAction) = withState {
|
||||||
when (action) {
|
when (action) {
|
||||||
is SharedSecureStorageAction.Cancel -> handleCancel()
|
is SharedSecureStorageAction.Cancel -> handleCancel()
|
||||||
is SharedSecureStorageAction.SubmitPassphrase -> handleSubmitPassphrase(action)
|
is SharedSecureStorageAction.SubmitPassphrase -> handleSubmitPassphrase(action)
|
||||||
SharedSecureStorageAction.UseKey -> handleUseKey()
|
SharedSecureStorageAction.UseKey -> handleUseKey()
|
||||||
is SharedSecureStorageAction.SubmitKey -> handleSubmitKey(action)
|
is SharedSecureStorageAction.SubmitKey -> handleSubmitKey(action)
|
||||||
SharedSecureStorageAction.Back -> handleBack()
|
SharedSecureStorageAction.Back -> handleBack()
|
||||||
SharedSecureStorageAction.ForgotResetAll -> handleResetAll()
|
SharedSecureStorageAction.ForgotResetAll -> handleResetAll()
|
||||||
SharedSecureStorageAction.DoResetAll -> handleDoResetAll()
|
SharedSecureStorageAction.DoResetAll -> handleDoResetAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class IncomingVerificationRequestHandler @Inject constructor(
|
|||||||
// TODO maybe check also if
|
// TODO maybe check also if
|
||||||
val uid = "kvr_${tx.transactionId}"
|
val uid = "kvr_${tx.transactionId}"
|
||||||
when (tx.state) {
|
when (tx.state) {
|
||||||
is VerificationTxState.OnStarted -> {
|
is VerificationTxState.OnStarted -> {
|
||||||
// Add a notification for every incoming request
|
// Add a notification for every incoming request
|
||||||
val user = session?.userService()?.getUser(tx.otherUserId)
|
val user = session?.userService()?.getUser(tx.otherUserId)
|
||||||
val name = user?.toMatrixItem()?.getBestName() ?: tx.otherUserId
|
val name = user?.toMatrixItem()?.getBestName() ?: tx.otherUserId
|
||||||
@ -116,7 +116,7 @@ class IncomingVerificationRequestHandler @Inject constructor(
|
|||||||
// cancel related notification
|
// cancel related notification
|
||||||
popupAlertManager.cancelAlert(uid)
|
popupAlertManager.cancelAlert(uid)
|
||||||
}
|
}
|
||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,9 +127,9 @@ class MergedHeaderItemFactory @Inject constructor(private val activeSessionHolde
|
|||||||
}
|
}
|
||||||
val mergeId = mergedEventIds.joinToString(separator = "_") { it.toString() }
|
val mergeId = mergedEventIds.joinToString(separator = "_") { it.toString() }
|
||||||
val summaryTitleResId = when (event.root.getClearType()) {
|
val summaryTitleResId = when (event.root.getClearType()) {
|
||||||
EventType.STATE_ROOM_MEMBER -> R.plurals.membership_changes
|
EventType.STATE_ROOM_MEMBER -> R.plurals.membership_changes
|
||||||
EventType.STATE_ROOM_SERVER_ACL -> R.plurals.notice_room_server_acl_changes
|
EventType.STATE_ROOM_SERVER_ACL -> R.plurals.notice_room_server_acl_changes
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
summaryTitleResId?.let { summaryTitle ->
|
summaryTitleResId?.let { summaryTitle ->
|
||||||
val attributes = MergedSimilarEventsItem.Attributes(
|
val attributes = MergedSimilarEventsItem.Attributes(
|
||||||
|
@ -78,10 +78,10 @@ abstract class AbstractLoginFragment<VB : ViewBinding> : VectorBaseFragment<VB>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (throwable) {
|
when (throwable) {
|
||||||
is CancellationException ->
|
is CancellationException ->
|
||||||
/* Ignore this error, user has cancelled the action */
|
/* Ignore this error, user has cancelled the action */
|
||||||
Unit
|
Unit
|
||||||
is Failure.ServerError ->
|
is Failure.ServerError ->
|
||||||
if (throwable.error.code == MatrixError.M_FORBIDDEN &&
|
if (throwable.error.code == MatrixError.M_FORBIDDEN &&
|
||||||
throwable.httpCode == HttpsURLConnection.HTTP_FORBIDDEN /* 403 */) {
|
throwable.httpCode == HttpsURLConnection.HTTP_FORBIDDEN /* 403 */) {
|
||||||
MaterialAlertDialogBuilder(requireActivity())
|
MaterialAlertDialogBuilder(requireActivity())
|
||||||
@ -94,7 +94,7 @@ abstract class AbstractLoginFragment<VB : ViewBinding> : VectorBaseFragment<VB>(
|
|||||||
}
|
}
|
||||||
is Failure.UnrecognizedCertificateFailure ->
|
is Failure.UnrecognizedCertificateFailure ->
|
||||||
showUnrecognizedCertificateFailure(throwable)
|
showUnrecognizedCertificateFailure(throwable)
|
||||||
else ->
|
else ->
|
||||||
onError(throwable)
|
onError(throwable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,12 +76,12 @@ abstract class AbstractLoginFragment2<VB : ViewBinding> : VectorBaseFragment<VB>
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (throwable) {
|
when (throwable) {
|
||||||
is CancellationException ->
|
is CancellationException ->
|
||||||
/* Ignore this error, user has cancelled the action */
|
/* Ignore this error, user has cancelled the action */
|
||||||
Unit
|
Unit
|
||||||
is Failure.UnrecognizedCertificateFailure ->
|
is Failure.UnrecognizedCertificateFailure ->
|
||||||
showUnrecognizedCertificateFailure(throwable)
|
showUnrecognizedCertificateFailure(throwable)
|
||||||
else ->
|
else ->
|
||||||
onError(throwable)
|
onError(throwable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ class RoomGroupMessageCreator @Inject constructor(
|
|||||||
private fun createRoomMessagesGroupSummaryLine(events: List<NotifiableMessageEvent>, roomName: String, roomIsDirect: Boolean): CharSequence {
|
private fun createRoomMessagesGroupSummaryLine(events: List<NotifiableMessageEvent>, roomName: String, roomIsDirect: Boolean): CharSequence {
|
||||||
return try {
|
return try {
|
||||||
when (events.size) {
|
when (events.size) {
|
||||||
1 -> createFirstMessageSummaryLine(events.first(), roomName, roomIsDirect)
|
1 -> createFirstMessageSummaryLine(events.first(), roomName, roomIsDirect)
|
||||||
else -> {
|
else -> {
|
||||||
stringProvider.getQuantityString(
|
stringProvider.getQuantityString(
|
||||||
R.plurals.notification_compat_summary_line_for_room,
|
R.plurals.notification_compat_summary_line_for_room,
|
||||||
|
@ -43,9 +43,9 @@ class DirectLoginUseCase @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun createSessionFor(data: WellknownResult, action: LoginOrRegister, config: HomeServerConnectionConfig?) = when (data) {
|
private suspend fun createSessionFor(data: WellknownResult, action: LoginOrRegister, config: HomeServerConnectionConfig?) = when (data) {
|
||||||
is WellknownResult.Prompt -> loginDirect(action, data, config)
|
is WellknownResult.Prompt -> loginDirect(action, data, config)
|
||||||
is WellknownResult.FailPrompt -> handleFailPrompt(data, action, config)
|
is WellknownResult.FailPrompt -> handleFailPrompt(data, action, config)
|
||||||
else -> onWellKnownError()
|
else -> onWellKnownError()
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun handleFailPrompt(data: WellknownResult.FailPrompt, action: LoginOrRegister, config: HomeServerConnectionConfig?): Result<Session> {
|
private suspend fun handleFailPrompt(data: WellknownResult.FailPrompt, action: LoginOrRegister, config: HomeServerConnectionConfig?): Result<Session> {
|
||||||
|
@ -80,11 +80,11 @@ abstract class AbstractFtueAuthFragment<VB : ViewBinding> : VectorBaseFragment<V
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (throwable) {
|
when (throwable) {
|
||||||
is CancellationException ->
|
is CancellationException ->
|
||||||
/* Ignore this error, user has cancelled the action */
|
/* Ignore this error, user has cancelled the action */
|
||||||
Unit
|
Unit
|
||||||
is Failure.UnrecognizedCertificateFailure -> showUnrecognizedCertificateFailure(throwable)
|
is Failure.UnrecognizedCertificateFailure -> showUnrecognizedCertificateFailure(throwable)
|
||||||
else -> onError(throwable)
|
else -> onError(throwable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,26 +138,26 @@ class FtueAuthCombinedRegisterFragment @Inject constructor() : AbstractSSOFtueAu
|
|||||||
// Trick to display the error without text.
|
// Trick to display the error without text.
|
||||||
views.createAccountInput.error = " "
|
views.createAccountInput.error = " "
|
||||||
when {
|
when {
|
||||||
throwable.isUsernameInUse() || throwable.isInvalidUsername() -> {
|
throwable.isUsernameInUse() || throwable.isInvalidUsername() -> {
|
||||||
views.createAccountInput.error = errorFormatter.toHumanReadable(throwable)
|
views.createAccountInput.error = errorFormatter.toHumanReadable(throwable)
|
||||||
}
|
}
|
||||||
throwable.isLoginEmailUnknown() -> {
|
throwable.isLoginEmailUnknown() -> {
|
||||||
views.createAccountInput.error = getString(R.string.login_login_with_email_error)
|
views.createAccountInput.error = getString(R.string.login_login_with_email_error)
|
||||||
}
|
}
|
||||||
throwable.isInvalidPassword() && views.createAccountPasswordInput.hasSurroundingSpaces() -> {
|
throwable.isInvalidPassword() && views.createAccountPasswordInput.hasSurroundingSpaces() -> {
|
||||||
views.createAccountPasswordInput.error = getString(R.string.auth_invalid_login_param_space_in_password)
|
views.createAccountPasswordInput.error = getString(R.string.auth_invalid_login_param_space_in_password)
|
||||||
}
|
}
|
||||||
throwable.isWeakPassword() || throwable.isInvalidPassword() -> {
|
throwable.isWeakPassword() || throwable.isInvalidPassword() -> {
|
||||||
views.createAccountPasswordInput.error = errorFormatter.toHumanReadable(throwable)
|
views.createAccountPasswordInput.error = errorFormatter.toHumanReadable(throwable)
|
||||||
}
|
}
|
||||||
throwable.isRegistrationDisabled() -> {
|
throwable.isRegistrationDisabled() -> {
|
||||||
MaterialAlertDialogBuilder(requireActivity())
|
MaterialAlertDialogBuilder(requireActivity())
|
||||||
.setTitle(R.string.dialog_title_error)
|
.setTitle(R.string.dialog_title_error)
|
||||||
.setMessage(getString(R.string.login_registration_disabled))
|
.setMessage(getString(R.string.login_registration_disabled))
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
super.onError(throwable)
|
super.onError(throwable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ class FtueAuthUseCaseFragment @Inject constructor(
|
|||||||
private fun createIcon(@ColorRes tint: Int, icon: Int, isLightMode: Boolean): Drawable {
|
private fun createIcon(@ColorRes tint: Int, icon: Int, isLightMode: Boolean): Drawable {
|
||||||
val context = requireContext()
|
val context = requireContext()
|
||||||
val alpha = when (isLightMode) {
|
val alpha = when (isLightMode) {
|
||||||
true -> LIGHT_MODE_ICON_BACKGROUND_ALPHA
|
true -> LIGHT_MODE_ICON_BACKGROUND_ALPHA
|
||||||
false -> DARK_MODE_ICON_BACKGROUND_ALPHA
|
false -> DARK_MODE_ICON_BACKGROUND_ALPHA
|
||||||
}
|
}
|
||||||
val iconBackground = context.getResTintedDrawable(R.drawable.bg_feature_icon, tint, alpha = alpha)
|
val iconBackground = context.getResTintedDrawable(R.drawable.bg_feature_icon, tint, alpha = alpha)
|
||||||
|
@ -94,7 +94,7 @@ class CreateRoomController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (viewState.roomJoinRules) {
|
when (viewState.roomJoinRules) {
|
||||||
RoomJoinRules.INVITE -> {
|
RoomJoinRules.INVITE -> {
|
||||||
buildProfileAction(
|
buildProfileAction(
|
||||||
id = "joinRule",
|
id = "joinRule",
|
||||||
title = stringProvider.getString(R.string.room_settings_room_access_private_title),
|
title = stringProvider.getString(R.string.room_settings_room_access_private_title),
|
||||||
@ -104,7 +104,7 @@ class CreateRoomController @Inject constructor(
|
|||||||
action = { host.listener?.selectVisibility() }
|
action = { host.listener?.selectVisibility() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RoomJoinRules.PUBLIC -> {
|
RoomJoinRules.PUBLIC -> {
|
||||||
buildProfileAction(
|
buildProfileAction(
|
||||||
id = "joinRule",
|
id = "joinRule",
|
||||||
title = stringProvider.getString(R.string.room_settings_room_access_public_title),
|
title = stringProvider.getString(R.string.room_settings_room_access_public_title),
|
||||||
@ -124,7 +124,7 @@ class CreateRoomController @Inject constructor(
|
|||||||
action = { host.listener?.selectVisibility() }
|
action = { host.listener?.selectVisibility() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// not yet supported
|
// not yet supported
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ class CreateSubSpaceController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (data.roomJoinRules) {
|
when (data.roomJoinRules) {
|
||||||
RoomJoinRules.INVITE -> {
|
RoomJoinRules.INVITE -> {
|
||||||
buildProfileAction(
|
buildProfileAction(
|
||||||
id = "joinRule",
|
id = "joinRule",
|
||||||
title = stringProvider.getString(R.string.room_settings_room_access_private_title),
|
title = stringProvider.getString(R.string.room_settings_room_access_private_title),
|
||||||
@ -122,7 +122,7 @@ class CreateSubSpaceController @Inject constructor(
|
|||||||
action = { host.listener?.selectVisibility() }
|
action = { host.listener?.selectVisibility() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RoomJoinRules.PUBLIC -> {
|
RoomJoinRules.PUBLIC -> {
|
||||||
buildProfileAction(
|
buildProfileAction(
|
||||||
id = "joinRule",
|
id = "joinRule",
|
||||||
title = stringProvider.getString(R.string.room_settings_room_access_public_title),
|
title = stringProvider.getString(R.string.room_settings_room_access_public_title),
|
||||||
@ -142,7 +142,7 @@ class CreateSubSpaceController @Inject constructor(
|
|||||||
action = { host.listener?.selectVisibility() }
|
action = { host.listener?.selectVisibility() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// not yet supported
|
// not yet supported
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ class RoomDirectoryPickerController @Inject constructor(
|
|||||||
}
|
}
|
||||||
when (data.addServerAsync) {
|
when (data.addServerAsync) {
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
is Fail -> settingsContinueCancelItem {
|
is Fail -> settingsContinueCancelItem {
|
||||||
id("continueCancel")
|
id("continueCancel")
|
||||||
continueText(host.stringProvider.getString(R.string.ok))
|
continueText(host.stringProvider.getString(R.string.ok))
|
||||||
canContinue(data.enteredServer.isNotEmpty())
|
canContinue(data.enteredServer.isNotEmpty())
|
||||||
|
@ -276,7 +276,7 @@ class RoomMemberProfileController @Inject constructor(
|
|||||||
|
|
||||||
if (canKick) {
|
if (canKick) {
|
||||||
when (membership) {
|
when (membership) {
|
||||||
Membership.JOIN -> {
|
Membership.JOIN -> {
|
||||||
buildProfileAction(
|
buildProfileAction(
|
||||||
id = "kick",
|
id = "kick",
|
||||||
editable = false,
|
editable = false,
|
||||||
@ -296,7 +296,7 @@ class RoomMemberProfileController @Inject constructor(
|
|||||||
action = { callback?.onCancelInviteClicked() }
|
action = { callback?.onCancelInviteClicked() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (canBan) {
|
if (canBan) {
|
||||||
|
@ -79,7 +79,7 @@ class RoomMemberListFragment @Inject constructor(
|
|||||||
object : RecyclerView.OnScrollListener() {
|
object : RecyclerView.OnScrollListener() {
|
||||||
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||||
when (newState) {
|
when (newState) {
|
||||||
RecyclerView.SCROLL_STATE_IDLE -> {
|
RecyclerView.SCROLL_STATE_IDLE -> {
|
||||||
if (withState(viewModel) { it.actionsPermissions.canInvite }) {
|
if (withState(viewModel) { it.actionsPermissions.canInvite }) {
|
||||||
views.inviteUsersButton.show()
|
views.inviteUsersButton.show()
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ class RoomPermissionsViewModel @AssistedInject constructor(@Assisted initialStat
|
|||||||
|
|
||||||
override fun handle(action: RoomPermissionsAction) {
|
override fun handle(action: RoomPermissionsAction) {
|
||||||
when (action) {
|
when (action) {
|
||||||
is RoomPermissionsAction.UpdatePermission -> updatePermission(action)
|
is RoomPermissionsAction.UpdatePermission -> updatePermission(action)
|
||||||
RoomPermissionsAction.ToggleShowAllPermissions -> toggleShowAllPermissions()
|
RoomPermissionsAction.ToggleShowAllPermissions -> toggleShowAllPermissions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class SpaceInviteBottomSheetViewModel @AssistedInject constructor(
|
|||||||
|
|
||||||
override fun handle(action: SpaceInviteBottomSheetAction) {
|
override fun handle(action: SpaceInviteBottomSheetAction) {
|
||||||
when (action) {
|
when (action) {
|
||||||
SpaceInviteBottomSheetAction.DoJoin -> {
|
SpaceInviteBottomSheetAction.DoJoin -> {
|
||||||
setState { copy(joinActionState = Loading()) }
|
setState { copy(joinActionState = Loading()) }
|
||||||
session.coroutineScope.launch(Dispatchers.IO) {
|
session.coroutineScope.launch(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
|
@ -150,9 +150,9 @@ class SpacePeopleListController @Inject constructor(
|
|||||||
|
|
||||||
private fun toPowerLevelLabel(categories: RoomMemberListCategories): String? {
|
private fun toPowerLevelLabel(categories: RoomMemberListCategories): String? {
|
||||||
return when (categories) {
|
return when (categories) {
|
||||||
RoomMemberListCategories.ADMIN -> stringProvider.getString(R.string.power_level_admin)
|
RoomMemberListCategories.ADMIN -> stringProvider.getString(R.string.power_level_admin)
|
||||||
RoomMemberListCategories.MODERATOR -> stringProvider.getString(R.string.power_level_moderator)
|
RoomMemberListCategories.MODERATOR -> stringProvider.getString(R.string.power_level_moderator)
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user