Rebase Fixes

This commit is contained in:
Valere 2021-02-23 09:56:46 +01:00
parent 5aa698768a
commit 883f70306f
7 changed files with 9 additions and 9 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 New Vector Ltd
* Copyright 2021 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View file

@ -31,7 +31,7 @@ class PowerLevelsHelper(private val powerLevelsContent: PowerLevelsContent) {
* @return the power level
*/
fun getUserPowerLevelValue(userId: String): Int {
return powerLevelsContent.users?.get(userId)
return powerLevelsContent.users.get(userId)
?: powerLevelsContent.usersDefault
}

View file

@ -50,7 +50,7 @@ internal fun JsonDict.toSafePowerLevelsContentDict(): JsonDict {
eventsDefault = content.eventsDefault,
events = content.events,
usersDefault = content.usersDefault,
users = content.users ?: emptyMap(),
users = content.users,
stateDefault = content.stateDefault,
notifications = content.notifications.mapValues { content.notificationLevel(it.key) }
)

View file

@ -124,7 +124,7 @@ internal class TokenChunkEventPersistor @Inject constructor(@SessionDatabase pri
direction: PaginationDirection): Result {
monarchy
.awaitTransaction { realm ->
Timber.v("Start persisting ${receivedChunk.events?.size} events in $roomId towards $direction")
Timber.v("Start persisting ${receivedChunk.events.size} events in $roomId towards $direction")
val nextToken: String?
val prevToken: String?
@ -189,7 +189,7 @@ internal class TokenChunkEventPersistor @Inject constructor(@SessionDatabase pri
receivedChunk: TokenChunkEvent,
currentChunk: ChunkEntity
) {
Timber.v("Add ${receivedChunk.events?.size} events in chunk(${currentChunk.nextToken} | ${currentChunk.prevToken}")
Timber.v("Add ${receivedChunk.events.size} events in chunk(${currentChunk.nextToken} | ${currentChunk.prevToken}")
val roomMemberContentsByUser = HashMap<String, RoomMemberContent?>()
val eventList = receivedChunk.events
val stateEvents = receivedChunk.stateEvents

View file

@ -94,7 +94,7 @@ internal class DefaultGetUploadsTask @Inject constructor(
nextToken = chunk.end ?: "",
hasMore = chunk.hasMore()
)
events = chunk.events ?: emptyList()
events = chunk.events
}
var uploadEvents = listOf<UploadEvent>()

View file

@ -21,7 +21,7 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentRoomDirectoryPickerBinding
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
@Parcelize
data class SpaceDirectoryArgs(

View file

@ -78,7 +78,7 @@ class SpacePreviewViewModel @AssistedInject constructor(
}
}
private fun handleDismissInvite() = withState { state ->
private fun handleDismissInvite() {
// Here we need to join the space himself as well as the default rooms in that space
// TODO modal loading
viewModelScope.launch(Dispatchers.IO) {
@ -108,7 +108,7 @@ class SpacePreviewViewModel @AssistedInject constructor(
_viewEvents.post(SpacePreviewViewEvents.JoinSuccess)
}
is SpaceService.JoinSpaceResult.Fail -> {
_viewEvents.post(SpacePreviewViewEvents.JoinFailure(joinResult.error?.toString()))
_viewEvents.post(SpacePreviewViewEvents.JoinFailure(joinResult.error.toString()))
}
}
}