Merge pull request #6593 from vector-im/task/eric/trailing-commas

Code style change: Trailing Commas
This commit is contained in:
Eric Decanini 2022-07-20 11:46:53 +02:00 committed by GitHub
commit a0bf1787cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 134 additions and 125 deletions

View File

@ -770,7 +770,7 @@ ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = true
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_assignment_wrap = off
ij_kotlin_blank_lines_after_class_header = 0

View File

@ -604,14 +604,16 @@ internal class MXOlmDevice @Inject constructor(
* @param sharedHistory MSC3061, this key is sharable on invite
* @return true if the operation succeeds.
*/
fun addInboundGroupSession(sessionId: String,
fun addInboundGroupSession(
sessionId: String,
sessionKey: String,
roomId: String,
senderKey: String,
forwardingCurve25519KeyChain: List<String>,
keysClaimed: Map<String, String>,
exportFormat: Boolean,
sharedHistory: Boolean): AddSessionResult {
sharedHistory: Boolean
): AddSessionResult {
val candidateSession = tryOrNull("Failed to create inbound session in room $roomId") {
if (exportFormat) {
OlmInboundGroupSession.importSession(sessionKey)

View File

@ -38,6 +38,7 @@ internal class MXMegolmDecryptionFactory @Inject constructor(
outgoingKeyRequestManager,
cryptoStore,
matrixConfiguration,
eventsManager)
eventsManager
)
}
}

View File

@ -250,8 +250,10 @@ internal class MXMegolmEncryption(
* @param sessionInfo the session info
* @param devicesByUser the devices map
*/
private suspend fun shareUserDevicesKey(sessionInfo: MXOutboundSessionInfo,
devicesByUser: Map<String, List<CryptoDeviceInfo>>) {
private suspend fun shareUserDevicesKey(
sessionInfo: MXOutboundSessionInfo,
devicesByUser: Map<String, List<CryptoDeviceInfo>>
) {
val sessionKey = olmDevice.getSessionKey(sessionInfo.sessionId) ?: return Unit.also {
Timber.tag(loggerTag.value).v("shareUserDevicesKey() Failed to share session, failed to export")
}

View File

@ -70,7 +70,7 @@ class AvatarRenderer @Inject constructor(
render(
GlideApp.with(imageView),
matrixItem,
DrawableImageViewTarget(imageView)
DrawableImageViewTarget(imageView),
)
}
@ -103,7 +103,7 @@ class AvatarRenderer @Inject constructor(
render(
glideRequests,
matrixItem,
DrawableImageViewTarget(imageView)
DrawableImageViewTarget(imageView),
)
}
@ -123,7 +123,7 @@ class AvatarRenderer @Inject constructor(
val matrixItem = MatrixItem.UserItem(
// Need an id starting with @
id = "@${mappedContact.displayName}",
displayName = mappedContact.displayName
displayName = mappedContact.displayName,
)
val placeholder = getPlaceholderDrawable(matrixItem)
@ -140,7 +140,7 @@ class AvatarRenderer @Inject constructor(
val matrixItem = MatrixItem.UserItem(
// Need an id starting with @
id = profileInfo.matrixId,
displayName = profileInfo.displayName
displayName = profileInfo.displayName,
)
val placeholder = getPlaceholderDrawable(matrixItem)
@ -215,7 +215,7 @@ class AvatarRenderer @Inject constructor(
.bold()
.endConfig()
.buildRect(matrixItem.firstLetterOfDisplayName(), avatarColor)
.toBitmap(width = iconSize, height = iconSize)
.toBitmap(width = iconSize, height = iconSize),
)
}
}
@ -231,7 +231,7 @@ class AvatarRenderer @Inject constructor(
addPlaceholder: Boolean
) {
val transformations = mutableListOf<Transformation<Bitmap>>(
BlurTransformation(20, sampling)
BlurTransformation(20, sampling),
)
if (colorFilter != null) {
transformations.add(ColorFilterTransformation(colorFilter))

View File

@ -73,26 +73,30 @@ class BiometricHelper @Inject constructor(
/**
* Returns true if a weak biometric method (i.e.: some face or iris unlock implementations) can be used.
*/
val canUseWeakBiometricAuth: Boolean get() =
val canUseWeakBiometricAuth: Boolean
get() =
configuration.isWeakBiometricsEnabled && biometricManager.canAuthenticate(BIOMETRIC_WEAK) == BIOMETRIC_SUCCESS
/**
* Returns true if a strong biometric method (i.e.: fingerprint, some face or iris unlock implementations) can be used.
*/
val canUseStrongBiometricAuth: Boolean get() =
val canUseStrongBiometricAuth: Boolean
get() =
configuration.isStrongBiometricsEnabled && biometricManager.canAuthenticate(BIOMETRIC_STRONG) == BIOMETRIC_SUCCESS
/**
* Returns true if the device credentials can be used to unlock (system pin code, password, pattern, etc.).
*/
val canUseDeviceCredentialsAuth: Boolean get() =
val canUseDeviceCredentialsAuth: Boolean
get() =
configuration.isDeviceCredentialUnlockEnabled && biometricManager.canAuthenticate(DEVICE_CREDENTIAL) == BIOMETRIC_SUCCESS
/**
* Returns true if any system authentication method (biometric weak/strong or device credentials) can be used.
*/
@VisibleForTesting(otherwise = PRIVATE)
internal val canUseAnySystemAuth: Boolean get() = canUseWeakBiometricAuth || canUseStrongBiometricAuth || canUseDeviceCredentialsAuth
internal val canUseAnySystemAuth: Boolean
get() = canUseWeakBiometricAuth || canUseStrongBiometricAuth || canUseDeviceCredentialsAuth
/**
* Returns true if any system authentication method and there is a valid associated key.