Merge pull request #967 from vector-im/feature/bma/detektConfig

Update detekt config.
This commit is contained in:
Benoit Marty 2023-07-28 16:47:26 +02:00 committed by GitHub
commit d06f86f79d
90 changed files with 296 additions and 198 deletions

View file

@ -95,9 +95,9 @@ object PermalinkParser {
return if (signUrl.isNullOrEmpty().not() && email.isNullOrEmpty().not()) {
try {
val signValidUri = Uri.parse(signUrl)
val identityServerHost = signValidUri.authority ?: throw IllegalArgumentException()
val token = signValidUri.getQueryParameter("token") ?: throw IllegalArgumentException()
val privateKey = signValidUri.getQueryParameter("private_key") ?: throw IllegalArgumentException()
val identityServerHost = signValidUri.authority ?: throw IllegalArgumentException("missing `authority`")
val token = signValidUri.getQueryParameter("token") ?: throw IllegalArgumentException("missing `token`")
val privateKey = signValidUri.getQueryParameter("private_key") ?: throw IllegalArgumentException("missing `private_key`")
PermalinkData.RoomEmailInviteLink(
roomId = identifier,
email = email!!,
@ -137,7 +137,8 @@ object PermalinkParser {
.parameterList
.filter {
it.mParameter == "via"
}.map {
}
.map {
URLDecoder.decode(it.mValue, "UTF-8")
}
}

View file

@ -147,7 +147,8 @@ class RustMatrixClient constructor(
if (syncState == SyncState.Running) {
onSlidingSyncUpdate()
}
}.launchIn(sessionCoroutineScope)
}
.launchIn(sessionCoroutineScope)
}
override suspend fun getRoom(roomId: RoomId): MatrixRoom? = withContext(sessionDispatcher) {
@ -227,7 +228,8 @@ class RustMatrixClient constructor(
roomSummaryDataSource.allRooms()
.filter { roomSummaries ->
roomSummaries.map { it.identifier() }.contains(roomId.value)
}.first()
}
.first()
}
roomId
}

View file

@ -93,7 +93,7 @@ class RustMatrixAuthenticationService @Inject constructor(
client.restoreSession(sessionData.toSession())
createMatrixClient(client)
} else {
throw IllegalStateException("No session to restore with id $sessionId")
error("No session to restore with id $sessionId")
}
}.mapFailure { failure ->
failure.mapClientException()

View file

@ -64,7 +64,8 @@ internal class RustRoomSummaryDataSource(
.map { it.toRoomSummaryDataSourceLoadingState() }
.onEach {
allRoomsLoadingState.value = it
}.launchIn(this)
}
.launchIn(this)
launch {
// Wait until running, as invites is only available after that

View file

@ -118,7 +118,8 @@ class RustMatrixTimeline(
innerRoom.backPaginationStatusFlow()
.onEach {
postPaginationStatus(it)
}.launchIn(this)
}
.launchIn(this)
taskHandleBag += fetchMembers().getOrNull()
}.invokeOnCompletion {

View file

@ -27,7 +27,7 @@ import java.util.Date
class TimelineEncryptedHistoryPostProcessorTest {
private val defaultLastLoginTimestamp = Date(1689061264L)
private val defaultLastLoginTimestamp = Date(1_689_061_264L)
@Test
fun `given an unencrypted room, nothing is done`() {