Remove JoinRule.Private from the codebase (#6129)
It shouldn't be in use, since it was never properly defined: - The `Private` values coming from the SDK are considered to be `Invite` instead. - Remove any existing `JoinRule.Private` usages in our code.
This commit is contained in:
parent
4fe7463679
commit
5175bacb5e
12 changed files with 14 additions and 46 deletions
|
|
@ -37,7 +37,6 @@ fun MediaPreviewValue?.isPreviewEnabled(joinRule: JoinRule?): Boolean {
|
|||
null, On -> true
|
||||
Off -> false
|
||||
Private -> when (joinRule) {
|
||||
is JoinRule.Private,
|
||||
is JoinRule.Knock,
|
||||
is JoinRule.Invite,
|
||||
is JoinRule.Restricted,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
@Immutable
|
||||
sealed interface JoinRule {
|
||||
data object Public : JoinRule
|
||||
data object Private : JoinRule
|
||||
data object Knock : JoinRule
|
||||
data object Invite : JoinRule
|
||||
data class Restricted(val rules: ImmutableList<AllowRule>) : JoinRule
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ import org.matrix.rustcomponents.sdk.JoinRule as RustJoinRule
|
|||
fun RustJoinRule.map(): JoinRule {
|
||||
return when (this) {
|
||||
RustJoinRule.Public -> JoinRule.Public
|
||||
RustJoinRule.Private -> JoinRule.Private
|
||||
// Assume a private join rule is invite only instead. Private shouldn't be in use in Matrix.
|
||||
RustJoinRule.Private -> JoinRule.Invite
|
||||
RustJoinRule.Knock -> JoinRule.Knock
|
||||
RustJoinRule.Invite -> JoinRule.Invite
|
||||
is RustJoinRule.Restricted -> JoinRule.Restricted(rules.map { it.map() }.toImmutableList())
|
||||
|
|
@ -27,7 +28,6 @@ fun RustJoinRule.map(): JoinRule {
|
|||
fun JoinRule.map(): RustJoinRule {
|
||||
return when (this) {
|
||||
JoinRule.Public -> RustJoinRule.Public
|
||||
JoinRule.Private -> RustJoinRule.Private
|
||||
JoinRule.Knock -> RustJoinRule.Knock
|
||||
JoinRule.Invite -> RustJoinRule.Invite
|
||||
is JoinRule.Restricted -> RustJoinRule.Restricted(rules.map { it.map() })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue