Merge branch 'develop' into patch-1

This commit is contained in:
Benoit Marty 2020-06-22 14:11:50 +02:00 committed by GitHub
commit 3ced179fbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 8 deletions

View File

@ -23,6 +23,8 @@ Build 🧱:
Other changes:
- Fix minor typo in contribution guide (#1512)
- Fix self-assignment of callback in `DefaultRoomPushRuleService#setRoomNotificationState` (#1520)
- Random housekeeping clean-ups indicated by Lint (#1520)
Changes in RiotX 0.22.0 (2020-06-15)
===================================================

View File

@ -252,7 +252,7 @@ class KeyShareTests : InstrumentedTest {
}
})
val txId: String = "m.testVerif12"
val txId = "m.testVerif12"
aliceVerificationService2.beginKeyVerification(VerificationMethod.SAS, aliceSession1.myUserId, aliceSession1.sessionParams.deviceId
?: "", txId)

View File

@ -69,7 +69,7 @@ data class HomeServerConnectionConfig(
*/
fun withHomeServerUri(hsUri: Uri): Builder {
if (hsUri.scheme != "http" && hsUri.scheme != "https") {
throw RuntimeException("Invalid home server URI: " + hsUri)
throw RuntimeException("Invalid home server URI: $hsUri")
}
// ensure trailing /
val hsString = hsUri.toString().ensureTrailingSlash()

View File

@ -28,7 +28,7 @@ import kotlin.math.ceil
*/
object HkdfSha256 {
public fun deriveSecret(inputKeyMaterial: ByteArray, salt: ByteArray?, info: ByteArray, outputLength: Int): ByteArray {
fun deriveSecret(inputKeyMaterial: ByteArray, salt: ByteArray?, info: ByteArray, outputLength: Int): ByteArray {
return expand(extract(salt, inputKeyMaterial), info, outputLength)
}

View File

@ -85,7 +85,7 @@ internal class SendVerificationMessageWorker(context: Context,
private const val OUTPUT_KEY_FAILED = "failed"
fun hasFailed(outputData: Data): Boolean {
return outputData.getBoolean(SendVerificationMessageWorker.OUTPUT_KEY_FAILED, false)
return outputData.getBoolean(OUTPUT_KEY_FAILED, false)
}
}
}

View File

@ -33,7 +33,7 @@ data class Fingerprint(
@Throws(CertificateException::class)
fun matchesCert(cert: X509Certificate): Boolean {
var o: Fingerprint? = when (hashType) {
val o: Fingerprint? = when (hashType) {
HashType.SHA256 -> newSha256Fingerprint(cert)
HashType.SHA1 -> newSha1Fingerprint(cert)
}

View File

@ -51,7 +51,7 @@ internal class DefaultRoomPushRuleService @AssistedInject constructor(@Assisted
override fun setRoomNotificationState(roomNotificationState: RoomNotificationState, matrixCallback: MatrixCallback<Unit>): Cancelable {
return setRoomNotificationStateTask
.configureWith(SetRoomNotificationStateTask.Params(roomId, roomNotificationState)) {
this.callback = callback
this.callback = matrixCallback
}
.executeBy(taskExecutor)
}

View File

@ -37,7 +37,7 @@ internal class MarkdownParser @Inject constructor(
fun parse(text: String): TextContent {
// If no special char are detected, just return plain text
if (text.contains(mdSpecialChars).not()) {
return TextContent(text.toString())
return TextContent(text)
}
val document = parser.parse(text)
@ -56,7 +56,7 @@ internal class MarkdownParser @Inject constructor(
val plainText = textContentRenderer.render(document)
TextContent(plainText, cleanHtmlText.postTreatment())
} else {
TextContent(text.toString())
TextContent(text)
}
}