From 51fd742272db4eb48560ccaa148f1b3073a1f9a0 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Tue, 16 Aug 2022 10:08:46 +0200 Subject: [PATCH 1/4] Version++ --- towncrier.toml | 2 +- vector/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/towncrier.toml b/towncrier.toml index 5f5203cacf..c8ea516789 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,5 +1,5 @@ [tool.towncrier] - version = "2.4.1" + version = "2.4.2" directory = "changelog.d" filename = "TCHAP_CHANGES.md" name = "Changes in Tchap" diff --git a/vector/build.gradle b/vector/build.gradle index 81befb4713..8c3ffaf207 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -35,7 +35,7 @@ ext.versionMinor = 4 // Note: even values are reserved for regular release, odd values for hotfix release. // When creating a hotfix, you should decrease the value, since the current value // is the value for the next regular release. -ext.versionPatch = 1 +ext.versionPatch = 2 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' From 5dcacd68335a17915a6b7c8eed896a611fa22023 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Mon, 29 Aug 2022 11:59:32 +0200 Subject: [PATCH 2/4] Fix wrong CreateRoomParams values This was caused to asynchronous changes inside the `withState` method, the CreateRoomParams object was returned before receiving the async changes --- changelog.d/695.bugfix | 1 + .../createroom/CreateRoomViewModel.kt | 62 +++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) create mode 100644 changelog.d/695.bugfix diff --git a/changelog.d/695.bugfix b/changelog.d/695.bugfix new file mode 100644 index 0000000000..fa0b4a1612 --- /dev/null +++ b/changelog.d/695.bugfix @@ -0,0 +1 @@ +Forum creation: limited to my domain is not working diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt index 04d54ee447..f9846d0052 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt @@ -262,7 +262,7 @@ class CreateRoomViewModel @AssistedInject constructor( } val createRoomParams = CreateRoomParams() - .setTchapParams() + .setTchapParams(state) .apply { name = state.roomName.takeIf { it.isNotBlank() } topic = state.roomTopic.takeIf { it.isNotBlank() } @@ -351,39 +351,37 @@ class CreateRoomViewModel @AssistedInject constructor( } } - private fun CreateRoomParams.setTchapParams() = apply { - withState { state -> - if (state.roomType == TchapRoomType.FORUM) { - // Directory visibility - visibility = RoomDirectoryVisibility.PUBLIC - // Preset - preset = CreateRoomPreset.PRESET_PUBLIC_CHAT - // In case of a public room, the room alias is mandatory. - // That's why, we deduce the room alias from the room name. - roomAliasName = TchapUtils.createRoomAliasName(state.roomName) - historyVisibility = RoomHistoryVisibility.WORLD_READABLE - } else { - // Directory visibility - visibility = RoomDirectoryVisibility.PRIVATE - // Preset - preset = CreateRoomPreset.PRESET_PRIVATE_CHAT - // Hide the encrypted messages sent before the member is invited. - historyVisibility = RoomHistoryVisibility.INVITED - // Encryption - enableEncryption() - } - - if (state.roomType == TchapRoomType.EXTERNAL) { - // Room access rule - setRoomAccessRulesInInitialStates(this, RoomAccessRules.UNRESTRICTED) - } else { - // Room access rule - setRoomAccessRulesInInitialStates(this, RoomAccessRules.RESTRICTED) - } + private fun CreateRoomParams.setTchapParams(state: CreateRoomViewState) = apply { + if (state.roomType == TchapRoomType.FORUM) { + // Directory visibility + visibility = RoomDirectoryVisibility.PUBLIC + // Preset + preset = CreateRoomPreset.PRESET_PUBLIC_CHAT + // In case of a public room, the room alias is mandatory. + // That's why, we deduce the room alias from the room name. + roomAliasName = TchapUtils.createRoomAliasName(state.roomName) + historyVisibility = RoomHistoryVisibility.WORLD_READABLE + } else { + // Directory visibility + visibility = RoomDirectoryVisibility.PRIVATE + // Preset + preset = CreateRoomPreset.PRESET_PRIVATE_CHAT + // Hide the encrypted messages sent before the member is invited. + historyVisibility = RoomHistoryVisibility.INVITED + // Encryption + enableEncryption() + } - // Disabling federation - disableFederation = state.disableFederation + if (state.roomType == TchapRoomType.EXTERNAL) { + // Room access rule + setRoomAccessRulesInInitialStates(this, RoomAccessRules.UNRESTRICTED) + } else { + // Room access rule + setRoomAccessRulesInInitialStates(this, RoomAccessRules.RESTRICTED) } + + // Disabling federation + disableFederation = state.disableFederation } /** From 52ec0ad3eb82ca215f013b31e3dc02736cba0d7d Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Mon, 29 Aug 2022 12:06:35 +0200 Subject: [PATCH 3/4] Fix fab strings --- vector/src/main/res/values-fr/strings_tchap.xml | 4 ++-- vector/src/main/res/values/strings.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vector/src/main/res/values-fr/strings_tchap.xml b/vector/src/main/res/values-fr/strings_tchap.xml index 9a1424efa7..55668bd7c3 100644 --- a/vector/src/main/res/values-fr/strings_tchap.xml +++ b/vector/src/main/res/values-fr/strings_tchap.xml @@ -45,7 +45,7 @@ Externes Forum %s vous a invité - Rejoindre un forum depuis l\'annuaire + Rejoindre un forum depuis l’annuaire Le document (%s) a été filtré par la politique de sécurité @@ -118,4 +118,4 @@ La vérification de votre nouvelle session a échoué. - \ No newline at end of file + diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 441f6c8695..5ccb60f9ee 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -1620,8 +1620,8 @@ "This room can't be previewed" This room is not accessible at this time.\nTry again later, or ask a room admin to check if you have access. "This room can't be previewed. Do you want to join it?" - "Rooms" - "Direct Messages" + "New room/forum" + "New Direct Messages" "CREATE" From e5667a4c56989a814a6193745c202932b1d1d0e8 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Mon, 29 Aug 2022 15:18:21 +0200 Subject: [PATCH 4/4] Generate changelog --- TCHAP_CHANGES.md | 13 ++++++++++++- changelog.d/458.improvments | 1 - changelog.d/605.improvments | 1 - changelog.d/668.improvments | 1 - changelog.d/695.bugfix | 1 - 5 files changed, 12 insertions(+), 5 deletions(-) delete mode 100644 changelog.d/458.improvments delete mode 100644 changelog.d/605.improvments delete mode 100644 changelog.d/668.improvments delete mode 100644 changelog.d/695.bugfix diff --git a/TCHAP_CHANGES.md b/TCHAP_CHANGES.md index b54d196a9c..ec50fc1d62 100644 --- a/TCHAP_CHANGES.md +++ b/TCHAP_CHANGES.md @@ -1,3 +1,11 @@ +Changes in Tchap 2.4.2 (2022-08-29) +=================================== + +Bugfixes 🐛 +---------- + - Forum creation: limited to my domain is not working ([#695](https://github.com/tchapgouv/tchap-android-v2/issues/695)) + + Changes in Tchap 2.4.1 (2022-08-16) =================================== @@ -11,12 +19,15 @@ Other changes - [Menu - Report Bug] Do not select "send screenshot" by default ([#686](https://github.com/tchapgouv/tchap-android-v2/issues/686)) - Remove Android Auto support ([#703](https://github.com/tchapgouv/tchap-android-v2/issues/703)) + Changes in Tchap 2.4.0 (2022-08-03) =================================== Improvements 🙌 -------------- - - Using a secondary button style in the case of binary actions ([#668](https://github.com/tchapgouv/tchap-android-v2/issues/668)) + - Use a secondary button style in the case of binary actions ([#668](https://github.com/tchapgouv/tchap-android-v2/issues/668)) + - [Manage Sessions] Restore the shields in the sessions list ([605](https://github.com/tchapgouv/tchap-android-v2/issues/605)) + - Enable cross-signing in Btchap and DevTchap, key backup in DevTchap ([458](https://github.com/tchapgouv/tchap-android-v2/issues/458)) Bugfixes 🐛 ---------- diff --git a/changelog.d/458.improvments b/changelog.d/458.improvments deleted file mode 100644 index 125eab2f7f..0000000000 --- a/changelog.d/458.improvments +++ /dev/null @@ -1 +0,0 @@ -Enable cross-signing in Btchap and dev and keyback-up in DevTchap diff --git a/changelog.d/605.improvments b/changelog.d/605.improvments deleted file mode 100644 index 1fdb528c00..0000000000 --- a/changelog.d/605.improvments +++ /dev/null @@ -1 +0,0 @@ -[Manage Sessions] Restore the shields in the list diff --git a/changelog.d/668.improvments b/changelog.d/668.improvments deleted file mode 100644 index 754492ffbc..0000000000 --- a/changelog.d/668.improvments +++ /dev/null @@ -1 +0,0 @@ -Using a secondary button style in the case of binary actions diff --git a/changelog.d/695.bugfix b/changelog.d/695.bugfix deleted file mode 100644 index fa0b4a1612..0000000000 --- a/changelog.d/695.bugfix +++ /dev/null @@ -1 +0,0 @@ -Forum creation: limited to my domain is not working