Address review comments.

Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
This commit is contained in:
Dominic Fischer 2019-10-21 22:29:36 +01:00
parent e28e2dadb9
commit d071324694
5 changed files with 6 additions and 5 deletions

View File

@ -63,7 +63,7 @@ internal class DeviceListManager @Inject constructor(private val cryptoStore: IM
private fun canRetryKeysDownload(userId: String): Boolean { private fun canRetryKeysDownload(userId: String): Boolean {
var res = false var res = false
if (userId.isNotEmpty() && userId.contains(":")) { if (':' in userId) {
try { try {
synchronized(notReadyToRetryHS) { synchronized(notReadyToRetryHS) {
res = !notReadyToRetryHS.contains(userId.substring(userId.lastIndexOf(":") + 1)) res = !notReadyToRetryHS.contains(userId.substring(userId.lastIndexOf(":") + 1))

View File

@ -95,7 +95,7 @@ internal class IncomingRoomKeyRequestManager @Inject constructor(
continue continue
} }
if (deviceId == credentials.deviceId && credentials.userId == userId) { if (credentials.deviceId == deviceId && credentials.userId == userId) {
Timber.v("## processReceivedRoomKeyRequests() : oneself device - ignored") Timber.v("## processReceivedRoomKeyRequests() : oneself device - ignored")
cryptoStore.deleteIncomingRoomKeyRequest(request) cryptoStore.deleteIncomingRoomKeyRequest(request)
continue continue

View File

@ -78,9 +78,10 @@ internal class TimelineEventDecryptor(
existingRequests.add(eventId) existingRequests.add(eventId)
} }
synchronized(unknownSessionsFailure) { synchronized(unknownSessionsFailure) {
unknownSessionsFailure.values.forEach { for (it in unknownSessionsFailure.values) {
if (eventId in it) { if (eventId in it) {
Timber.d("Skip Decryption request for event $eventId, unknown session") Timber.d("Skip Decryption request for event $eventId, unknown session")
break
} }
} }
} }

View File

@ -132,5 +132,5 @@ fun getSizeOfFiles(context: Context, root: File): Int {
Timber.v("Get size of ${it.absolutePath}") Timber.v("Get size of ${it.absolutePath}")
true true
} }
.sumBy { root.length().toInt() } .sumBy { it.length().toInt() }
} }

View File

@ -148,7 +148,7 @@ class RoomListViewModel @AssistedInject constructor(@Assisted initialState: Room
setState { setState {
copy( copy(
joiningRoomsIds = joiningRoomsIds - roomId, joiningRoomsIds = joiningRoomsIds - roomId,
joiningErrorRoomsIds = joiningErrorRoomsIds - roomId joiningErrorRoomsIds = joiningErrorRoomsIds + roomId
) )
} }
} }