mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
using consistent method naming for setting the capabilities override
This commit is contained in:
parent
bdedffbb4f
commit
edee6abafa
2 changed files with 3 additions and 3 deletions
|
@ -63,7 +63,7 @@ class DebugVectorOverrides(private val context: Context) : VectorOverrides {
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun updateHomeserverCapabilities(block: HomeserverCapabilitiesOverride.() -> HomeserverCapabilitiesOverride) {
|
||||
suspend fun setHomeserverCapabilities(block: HomeserverCapabilitiesOverride.() -> HomeserverCapabilitiesOverride) {
|
||||
val capabilitiesOverride = block(forceHomeserverCapabilities.firstOrNull() ?: HomeserverCapabilitiesOverride(null, null))
|
||||
context.dataStore.edit { settings ->
|
||||
when (capabilitiesOverride.canChangeDisplayName) {
|
||||
|
|
|
@ -89,14 +89,14 @@ class DebugPrivateSettingsViewModel @AssistedInject constructor(
|
|||
private fun handSetDisplayNameCapabilityOverride(action: SetDisplayNameCapabilityOverride) {
|
||||
viewModelScope.launch {
|
||||
val forceDisplayName = action.option.toBoolean()
|
||||
debugVectorOverrides.updateHomeserverCapabilities { copy(canChangeDisplayName = forceDisplayName) }
|
||||
debugVectorOverrides.setHomeserverCapabilities { copy(canChangeDisplayName = forceDisplayName) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun handSetAvatarCapabilityOverride(action: SetAvatarCapabilityOverride) {
|
||||
viewModelScope.launch {
|
||||
val forceAvatar = action.option.toBoolean()
|
||||
debugVectorOverrides.updateHomeserverCapabilities { copy(canChangeAvatar = forceAvatar) }
|
||||
debugVectorOverrides.setHomeserverCapabilities { copy(canChangeAvatar = forceAvatar) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue