From f230830763a977a103c70a02e382ef51a6c797ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Mar 2021 07:07:15 +0000 Subject: [PATCH 1/9] Bump mockk-android from 1.10.6 to 1.11.0 Bumps [mockk-android](https://github.com/mockk/mockk) from 1.10.6 to 1.11.0. - [Release notes](https://github.com/mockk/mockk/releases) - [Commits](https://github.com/mockk/mockk/compare/1.10.6...1.11.0) Signed-off-by: dependabot[bot] --- matrix-sdk-android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index c9918cceaf..8e0f1ff269 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -186,7 +186,7 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'org.amshove.kluent:kluent-android:1.61' // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 - androidTestImplementation 'io.mockk:mockk-android:1.10.6' + androidTestImplementation 'io.mockk:mockk-android:1.11.0' androidTestImplementation "androidx.arch.core:core-testing:$arch_version" androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" // Plant Timber tree for test From 118ea4b0b2ff2f0d814943a1500b2e2cdecd7611 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Mar 2021 07:08:12 +0000 Subject: [PATCH 2/9] Bump mockk from 1.10.6 to 1.11.0 Bumps [mockk](https://github.com/mockk/mockk) from 1.10.6 to 1.11.0. - [Release notes](https://github.com/mockk/mockk/releases) - [Commits](https://github.com/mockk/mockk/compare/1.10.6...1.11.0) Signed-off-by: dependabot[bot] --- matrix-sdk-android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index c9918cceaf..464dea8161 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -172,7 +172,7 @@ dependencies { testImplementation 'org.robolectric:robolectric:4.5.1' //testImplementation 'org.robolectric:shadows-support-v4:3.0' // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 - testImplementation 'io.mockk:mockk:1.10.6' + testImplementation 'io.mockk:mockk:1.11.0' testImplementation 'org.amshove.kluent:kluent-android:1.65' testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" // Plant Timber tree for test From 8e85d5515d133f8ab6b147d06e9dcebaabfeed8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 07:18:33 +0000 Subject: [PATCH 3/9] Bump libphonenumber from 8.12.19 to 8.12.20 Bumps [libphonenumber](https://github.com/google/libphonenumber) from 8.12.19 to 8.12.20. - [Release notes](https://github.com/google/libphonenumber/releases) - [Changelog](https://github.com/google/libphonenumber/blob/master/making-metadata-changes.md) - [Commits](https://github.com/google/libphonenumber/compare/v8.12.19...v8.12.20) Signed-off-by: dependabot[bot] --- matrix-sdk-android/build.gradle | 2 +- vector/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index c9918cceaf..17d8fe59a0 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -166,7 +166,7 @@ dependencies { implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1' // Phone number https://github.com/google/libphonenumber - implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.19' + implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.20' testImplementation 'junit:junit:4.13.2' testImplementation 'org.robolectric:robolectric:4.5.1' diff --git a/vector/build.gradle b/vector/build.gradle index 0468c68614..10fae97106 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -342,7 +342,7 @@ dependencies { implementation 'com.facebook.stetho:stetho:1.5.1' // Phone number https://github.com/google/libphonenumber - implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.19' + implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.20' // rx implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0' From 973e111dad86144026a55ba3e69793f5d1c76471 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 12:12:17 +0000 Subject: [PATCH 4/9] Bump epoxy_version from 4.4.2 to 4.4.3 Bumps `epoxy_version` from 4.4.2 to 4.4.3. Updates `epoxy` from 4.4.2 to 4.4.3 - [Release notes](https://github.com/airbnb/epoxy/releases) - [Changelog](https://github.com/airbnb/epoxy/blob/master/CHANGELOG.md) - [Commits](https://github.com/airbnb/epoxy/commits) Updates `epoxy-glide-preloading` from 4.4.2 to 4.4.3 - [Release notes](https://github.com/airbnb/epoxy/releases) - [Changelog](https://github.com/airbnb/epoxy/blob/master/CHANGELOG.md) - [Commits](https://github.com/airbnb/epoxy/commits) Updates `epoxy-processor` from 4.4.2 to 4.4.3 - [Release notes](https://github.com/airbnb/epoxy/releases) - [Changelog](https://github.com/airbnb/epoxy/blob/master/CHANGELOG.md) - [Commits](https://github.com/airbnb/epoxy/commits) Updates `epoxy-paging` from 4.4.2 to 4.4.3 - [Release notes](https://github.com/airbnb/epoxy/releases) - [Changelog](https://github.com/airbnb/epoxy/blob/master/CHANGELOG.md) - [Commits](https://github.com/airbnb/epoxy/commits) Signed-off-by: dependabot[bot] --- vector/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/build.gradle b/vector/build.gradle index ab3d2dc449..70538b100a 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -290,7 +290,7 @@ android { dependencies { - def epoxy_version = '4.4.2' + def epoxy_version = '4.4.3' def fragment_version = '1.3.0' def arrow_version = "0.8.2" def markwon_version = '4.1.2' From 35635c859d973aa55d0c18933ad03bae753388e7 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 18 Mar 2021 15:08:56 +0100 Subject: [PATCH 5/9] Send several NO_OLM in one request --- CHANGES.md | 2 +- .../algorithms/megolm/MXMegolmEncryption.kt | 39 +++++++++++-------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cad62d0851..c7f214e1c0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,7 @@ Features ✨: - Improvements 🙌: - - + - Crypto improvement | Bulck send NO_OLM withheld code Bugfix 🐛: - diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt index 6b91c0b859..cf13f0e789 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt @@ -67,8 +67,9 @@ internal class MXMegolmEncryption( init { // restore existing outbound session if any - outboundSession = olmDevice.restoreOutboundGroupSessionForRoom(roomId) + outboundSession = olmDevice.restoreOutboundGroupSessionForRoom(roomId) } + // Default rotation periods // TODO: Make it configurable via parameters // Session rotation periods @@ -125,6 +126,7 @@ internal class MXMegolmEncryption( Timber.v("## CRYPTO | preshareKey ${System.currentTimeMillis() - ts} millis") } + /** * Prepare a new session. * @@ -240,6 +242,7 @@ internal class MXMegolmEncryption( val contentMap = MXUsersDevicesMap() var haveTargets = false val userIds = results.userIds + val noOlmToNotify = mutableListOf() for (userId in userIds) { val devicesToShareWith = devicesByUser[userId] for ((deviceID) in devicesToShareWith!!) { @@ -251,13 +254,7 @@ internal class MXMegolmEncryption( // MSC 2399 // send withheld m.no_olm: an olm session could not be established. // This may happen, for example, if the sender was unable to obtain a one-time key from the recipient. - notifyKeyWithHeld( - listOf(UserDevice(userId, deviceID)), - session.sessionId, - olmDevice.deviceCurve25519Key, - WithHeldCode.NO_OLM - ) - + noOlmToNotify.add(UserDevice(userId, deviceID)) continue } Timber.i("## CRYPTO | shareUserDevicesKey() : Add to share keys contentMap for $userId:$deviceID") @@ -277,14 +274,14 @@ internal class MXMegolmEncryption( session.sharedWithHelper.markedSessionAsShared(userId, deviceId, chainIndex) gossipingEventBuffer.add( Event( - type = EventType.ROOM_KEY, - senderId = this.userId, - content = submap.apply { - this["session_key"] = "" - // we add a fake key for trail - this["_dest"] = "$userId|$deviceId" - } - )) + type = EventType.ROOM_KEY, + senderId = this.userId, + content = submap.apply { + this["session_key"] = "" + // we add a fake key for trail + this["_dest"] = "$userId|$deviceId" + } + )) } } @@ -304,6 +301,16 @@ internal class MXMegolmEncryption( } else { Timber.i("## CRYPTO | shareUserDevicesKey() : no need to sharekey") } + + if (noOlmToNotify.isNotEmpty()) { + //XXX offload?, as they won't read the message anyhow? + notifyKeyWithHeld( + noOlmToNotify, + session.sessionId, + olmDevice.deviceCurve25519Key, + WithHeldCode.NO_OLM + ) + } } private suspend fun notifyKeyWithHeld(targets: List, From 9f475989509984e2cc84e9c88527456885249cd4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Mar 2021 18:01:21 +0100 Subject: [PATCH 6/9] Display the room shield in all room setting screens --- CHANGES.md | 2 +- .../app/features/roomprofile/alias/RoomAliasFragment.kt | 1 + .../roomprofile/banned/RoomBannedMemberListFragment.kt | 1 + .../roomprofile/members/RoomMemberListFragment.kt | 1 + .../roomprofile/permissions/RoomPermissionsFragment.kt | 1 + .../roomprofile/settings/RoomSettingsFragment.kt | 1 + .../main/res/layout/fragment_room_setting_generic.xml | 9 +++++++++ 7 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index cad62d0851..e559879648 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,7 @@ Features ✨: - Improvements 🙌: - - + - Display the room shield in all room setting screens Bugfix 🐛: - diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt index 2fc1575341..1c5f8fe3af 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/alias/RoomAliasFragment.kt @@ -128,6 +128,7 @@ class RoomAliasFragment @Inject constructor( state.roomSummary()?.let { views.roomSettingsToolbarTitleView.text = it.displayName avatarRenderer.render(it.toMatrixItem(), views.roomSettingsToolbarAvatarImageView) + views.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel) } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt index 556d950230..620d65781c 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/banned/RoomBannedMemberListFragment.kt @@ -117,6 +117,7 @@ class RoomBannedMemberListFragment @Inject constructor( state.roomSummary()?.let { views.roomSettingsToolbarTitleView.text = it.displayName avatarRenderer.render(it.toMatrixItem(), views.roomSettingsToolbarAvatarImageView) + views.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel) } } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt index 1db9200451..2ff89d6e54 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt @@ -140,6 +140,7 @@ class RoomMemberListFragment @Inject constructor( state.roomSummary()?.let { views.roomSettingGeneric.roomSettingsToolbarTitleView.text = it.displayName avatarRenderer.render(it.toMatrixItem(), views.roomSettingGeneric.roomSettingsToolbarAvatarImageView) + views.roomSettingGeneric.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel) } } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt index 61635c9b31..a538c9269b 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/permissions/RoomPermissionsFragment.kt @@ -91,6 +91,7 @@ class RoomPermissionsFragment @Inject constructor( state.roomSummary()?.let { views.roomSettingsToolbarTitleView.text = it.displayName avatarRenderer.render(it.toMatrixItem(), views.roomSettingsToolbarAvatarImageView) + views.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel) } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt index e431dbfcd6..129888ee04 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt @@ -154,6 +154,7 @@ class RoomSettingsFragment @Inject constructor( state.roomSummary()?.let { views.roomSettingsToolbarTitleView.text = it.displayName avatarRenderer.render(it.toMatrixItem(), views.roomSettingsToolbarAvatarImageView) + views.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel) } invalidateOptionsMenu() diff --git a/vector/src/main/res/layout/fragment_room_setting_generic.xml b/vector/src/main/res/layout/fragment_room_setting_generic.xml index c11ce07062..9c3827f919 100644 --- a/vector/src/main/res/layout/fragment_room_setting_generic.xml +++ b/vector/src/main/res/layout/fragment_room_setting_generic.xml @@ -34,6 +34,15 @@ app:layout_constraintTop_toTopOf="parent" tools:src="@tools:sample/avatars" /> + + Date: Fri, 19 Mar 2021 07:11:14 +0000 Subject: [PATCH 7/9] Bump gradle from 4.1.2 to 4.1.3 Bumps gradle from 4.1.2 to 4.1.3. Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ec7ec8c1de..4e2c81a379 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' + classpath 'com.android.tools.build:gradle:4.1.3' classpath 'com.google.gms:google-services:4.3.5' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1' From cfefde0c06f3b1baa354a81c0075a5bc032097ab Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Mar 2021 10:23:23 +0100 Subject: [PATCH 8/9] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c7f214e1c0..8e302599ac 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,7 @@ Features ✨: - Improvements 🙌: - - Crypto improvement | Bulck send NO_OLM withheld code + - Crypto improvement | Bulk send NO_OLM withheld code Bugfix 🐛: - From 2d75c67aa39a0267ac9886f3479efe76969074a1 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Mar 2021 10:24:40 +0100 Subject: [PATCH 9/9] ktlint --- .../sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt index cf13f0e789..697711d051 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt @@ -303,7 +303,7 @@ internal class MXMegolmEncryption( } if (noOlmToNotify.isNotEmpty()) { - //XXX offload?, as they won't read the message anyhow? + // XXX offload?, as they won't read the message anyhow? notifyKeyWithHeld( noOlmToNotify, session.sessionId,