Skip to content

Commit b6680ac

Browse files
authored
Add a developer option for history sharing on invite (#4821)
Adds a new developer flag, enabling our experimental support for MSC4268.
1 parent 680b63d commit b6680ac

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ enum class FeatureFlags(
112112
defaultValue = { false },
113113
isFinished = false,
114114
),
115+
EnableKeyShareOnInvite(
116+
key = "feature.enableKeyShareOnInvite",
117+
title = "Share encrypted history with new members",
118+
description = "When inviting a user to an encrypted room that has history visibility set to \"shared\"," +
119+
" share encrypted history with that user, and accept encrypted history when you are invited to such a room." +
120+
"\nRequires an app restart to take effect." +
121+
"\n\nWARNING: this feature is EXPERIMENTAL and not all security precautions are implemented." +
122+
" Do not enable on production accounts.",
123+
defaultValue = { false },
124+
isFinished = false,
125+
),
115126
Knock(
116127
key = "feature.knock",
117128
title = "Ask to join",

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class RustMatrixClientFactory @Inject constructor(
127127
TrustRequirement.UNTRUSTED
128128
}
129129
)
130+
.enableShareHistoryOnInvite(featureFlagService.isFeatureEnabled(FeatureFlags.EnableKeyShareOnInvite))
130131
.run {
131132
// Apply sliding sync version settings
132133
when (slidingSyncType) {

libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiClientBuilder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class FakeFfiClientBuilder : ClientBuilder(NoPointer) {
4141
override fun slidingSyncVersionBuilder(versionBuilder: SlidingSyncVersionBuilder) = this
4242
override fun userAgent(userAgent: String) = this
4343
override fun username(username: String) = this
44+
override fun enableShareHistoryOnInvite(enableShareHistoryOnInvite: Boolean): ClientBuilder = this
4445

4546
override suspend fun buildWithQrCode(qrCodeData: QrCodeData, oidcConfiguration: OidcConfiguration, progressListener: QrLoginProgressListener): Client {
4647
return FakeFfiClient()

0 commit comments

Comments
 (0)