mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 04:08:44 +03:00
Cleaning
This commit is contained in:
parent
5adceaca23
commit
88fec379c4
5 changed files with 12 additions and 41 deletions
|
@ -15,7 +15,6 @@
|
|||
*/
|
||||
package org.matrix.android.sdk.internal.crypto.tasks
|
||||
|
||||
import dagger.Lazy
|
||||
import org.matrix.android.sdk.api.session.events.model.Event
|
||||
import org.matrix.android.sdk.api.session.room.send.SendState
|
||||
import org.matrix.android.sdk.internal.crypto.CryptoSessionInfoProvider
|
||||
|
@ -35,7 +34,7 @@ internal interface SendVerificationMessageTask : Task<SendVerificationMessageTas
|
|||
|
||||
internal class DefaultSendVerificationMessageTask @Inject constructor(
|
||||
private val localEchoRepository: LocalEchoRepository,
|
||||
private val encryptEventTask: Lazy<DefaultEncryptEventTask>,
|
||||
private val encryptEventTask: DefaultEncryptEventTask,
|
||||
private val roomAPI: RoomAPI,
|
||||
private val cryptoSessionInfoProvider: CryptoSessionInfoProvider,
|
||||
private val globalErrorReceiver: GlobalErrorReceiver) : SendVerificationMessageTask {
|
||||
|
@ -65,7 +64,7 @@ internal class DefaultSendVerificationMessageTask @Inject constructor(
|
|||
private suspend fun handleEncryption(params: SendVerificationMessageTask.Params): Event {
|
||||
if (cryptoSessionInfoProvider.isRoomEncrypted(params.event.roomId ?: "")) {
|
||||
try {
|
||||
return encryptEventTask.get().execute(EncryptEventTask.Params(
|
||||
return encryptEventTask.execute(EncryptEventTask.Params(
|
||||
params.event.roomId ?: "",
|
||||
params.event,
|
||||
listOf("m.relates_to")
|
||||
|
|
|
@ -60,12 +60,14 @@ internal object HomeServerCapabilitiesMapper {
|
|||
val support = (it["support"] as? List<*>)?.filterIsInstance<String>()
|
||||
entry.key to RoomCapabilitySupport(preferred, support.orEmpty())
|
||||
}
|
||||
}?.toMap() ?: mapOf(
|
||||
HomeServerCapabilities.ROOM_CAP_RESTRICTED to RoomCapabilitySupport(
|
||||
preferred = null,
|
||||
support = listOf("org.matrix.msc3083")
|
||||
)
|
||||
)
|
||||
}?.toMap()
|
||||
// Just for debug purpose
|
||||
// ?: mapOf(
|
||||
// HomeServerCapabilities.ROOM_CAP_RESTRICTED to RoomCapabilitySupport(
|
||||
// preferred = null,
|
||||
// support = listOf("org.matrix.msc3083")
|
||||
// )
|
||||
// )
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.matrix.android.sdk.api.session.room.model.SpaceParentInfo
|
|||
import org.matrix.android.sdk.api.session.room.model.tag.RoomTag
|
||||
import org.matrix.android.sdk.internal.database.model.RoomSummaryEntity
|
||||
import org.matrix.android.sdk.internal.session.typing.DefaultTypingUsersTracker
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class RoomSummaryMapper @Inject constructor(private val timelineEventMapper: TimelineEventMapper,
|
||||
|
@ -39,7 +38,7 @@ internal class RoomSummaryMapper @Inject constructor(private val timelineEventMa
|
|||
}
|
||||
// typings are updated through the sync where room summary entity gets updated no matter what, so it's ok get there
|
||||
val typingUsers = typingUsersTracker.getTypingUsers(roomSummaryEntity.roomId)
|
||||
Timber.i("[${roomSummaryEntity.displayName ?: "?"}] roomSummaryEntity.flattenParentIds: <${roomSummaryEntity.flattenParentIds?.take(400)}>")
|
||||
|
||||
return RoomSummary(
|
||||
roomId = roomSummaryEntity.roomId,
|
||||
displayName = roomSummaryEntity.displayName ?: "",
|
||||
|
@ -98,7 +97,7 @@ internal class RoomSummaryMapper @Inject constructor(private val timelineEventMa
|
|||
worldReadable = it.childSummaryEntity?.joinRules == RoomJoinRules.PUBLIC
|
||||
)
|
||||
},
|
||||
flattenParentIds = roomSummaryEntity.flattenParentIds?.split('|', ignoreCase = false, limit = 100) ?: emptyList()
|
||||
flattenParentIds = roomSummaryEntity.flattenParentIds?.split("|") ?: emptyList()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,8 +69,6 @@ internal class CreateRoomBodyBuilder @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
params.featurePreset?.updateRoomParams(params)
|
||||
|
||||
val initialStates = (
|
||||
|
@ -152,19 +150,6 @@ internal class CreateRoomBodyBuilder @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
// private fun buildJoinRulesRestricted(params: CreateRoomParams): Event? {
|
||||
// return params.joinRuleRestricted
|
||||
// ?.let { allowList ->
|
||||
// Event(
|
||||
// type = EventType.STATE_ROOM_JOIN_RULES,
|
||||
// stateKey = "",
|
||||
// content = RoomJoinRulesContent(
|
||||
// _joinRules = RoomJoinRules.RESTRICTED.value,
|
||||
// allowList = allowList
|
||||
// ).toContent()
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Add the crypto algorithm to the room creation parameters.
|
||||
|
|
|
@ -180,20 +180,6 @@ class RoomSettingsFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onJoinRuleClicked() {
|
||||
// = withState(viewModel) { state ->
|
||||
// val currentJoinRule = state.newRoomJoinRules.newJoinRules ?: state.currentRoomJoinRules
|
||||
// val allowedRules = if (state.supportsRestricted) {
|
||||
// listOf(
|
||||
// RoomJoinRules.INVITE, RoomJoinRules.PUBLIC, RoomJoinRules.RESTRICTED
|
||||
// )
|
||||
// } else {
|
||||
// listOf(
|
||||
// RoomJoinRules.INVITE, RoomJoinRules.PUBLIC
|
||||
// )
|
||||
// }
|
||||
// RoomJoinRuleBottomSheet.newInstance(currentJoinRule, allowedRules)
|
||||
// .show(childFragmentManager, "RoomJoinRuleBottomSheet")
|
||||
|
||||
startActivity(RoomJoinRuleActivity.newIntent(requireContext(), roomProfileArgs.roomId))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue