diff --git a/changelog.d/8540.bugfix b/changelog.d/8540.bugfix new file mode 100644 index 00000000000..7a89922dbdf --- /dev/null +++ b/changelog.d/8540.bugfix @@ -0,0 +1 @@ +Respect isShareKeysOnInviteEnabled() flag when creating new outbound megolm sessions in rooms with history sharing enabled diff --git a/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt b/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt index e3595f66189..bafbcc7808c 100644 --- a/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt +++ b/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt @@ -930,7 +930,7 @@ internal class RealmCryptoStore @Inject constructor( val info = realm.createObject(OutboundGroupSessionInfoEntity::class.java).apply { creationTime = clock.epochMillis() // Store the room history visibility on the outbound session creation - shouldShareHistory = entity.shouldShareHistory + shouldShareHistory = isShareKeysOnInviteEnabled() && entity.shouldShareHistory putOutboundGroupSession(outboundGroupSession) } entity.outboundSessionInfo = info