Skip to content

Commit

Permalink
Merge branch 'tchapgouv:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DanyPM authored Nov 6, 2024
2 parents 213fce1 + 86fb5d1 commit 454ca1d
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 21 deletions.
28 changes: 28 additions & 0 deletions TCHAP_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
Changes in Tchap 2.13.8 (2024-10-31)
====================================

Features ✨
----------
- Activation des appels vidéos pour Intradef en beta externe. ([#1120](https://github.com/tchapgouv/tchap-android/issues/1120))

Changes in Tchap 2.13.7 (2024-10-31)
====================================

Features ✨
----------
- Ne pas forcer la génération du code de récupération et la sauvegarde automatique en production.

Changes in Tchap 2.13.6 (2024-10-30)
====================================

Features ✨
----------
- Activation des appels vidéos pour Éducation et Agent. ([#1121](https://github.com/tchapgouv/tchap-android/issues/1121))

Improvements 🙌
--------------
- Ajout d'une description pour le paramètre de notifications du compte. ([#1107](https://github.com/tchapgouv/tchap-android/issues/1107))
- Améliorer l'explication pour la génération d'un nouveau code de récupération. ([#1113](https://github.com/tchapgouv/tchap-android/issues/1113))
- Faciliter l'accès à l'aide sur la vérification d'appareil. ([#1116](https://github.com/tchapgouv/tchap-android/issues/1116))
- Améliorer l'explication pour un utilisateur voulant rejoindre un salon sans autorisation. ([#1118](https://github.com/tchapgouv/tchap-android/issues/1118))

Changes in Tchap 2.13.5 (2024-10-01)
====================================

Expand Down
1 change: 0 additions & 1 deletion changelog.d/1107.improvements

This file was deleted.

4 changes: 2 additions & 2 deletions library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@
<string name="power_level_edit_title">Définir le rôle</string>
<string name="secure_backup_reset_no_history">Vous redémarrerez sans aucun historique, message, appareil ou utilisateurs connus</string>
<string name="secure_backup_reset_if_you_reset_all">Si vous réinitialisez tout</string>
<string name="secure_backup_reset_all_no_other_devices">Uniquement si vous avez perdu votre Code et n\'avez aucun autre appareil connecté à ${app_name}.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all_no_other_devices">Uniquement si vous avez perdu votre code et n\'avez aucun autre appareil connecté à ${app_name}.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all">Réinitialiser tout</string>
<string name="bad_passphrase_key_reset_all_action">Générer un nouveau Code de Récupération</string> <!-- Tchap: Use custom string -->
<string name="error_saving_media_file">Impossible d’enregistrer le fichier multimédia</string>
Expand Down Expand Up @@ -2940,7 +2940,7 @@
<string name="pill_message_from_unknown_user">Message</string>
<string name="pill_message_from_user">Message de %s</string>
<string name="encrypted_by_deleted">Chiffré par un appareil supprimé</string>
<string name="secure_backup_reset_danger_warning">Veuillez ne continuer que si vous êtes certain d’avoir perdu tous vos autres appareils et votre Code de Récupération.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_danger_warning">Veuillez continuer uniquement si vous êtes certain·e d’avoir perdu votre Code de Récupération et qu’aucun autres appareils n’a accès à l’historique de vos messages.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all_no_other_devices_long">La réinitialisation ne peut pas être annulée. Vous n’aurez plus accès à vos anciens messages chiffrés.</string> <!-- Tchap: Use custom string -->
<string name="verification_not_found">La demande de vérification n’a pas été trouvée. Elle a peut-être été annulée, ou prise en charge dans une autre session.</string>
<string name="verification_request_was_sent">Une demande de vérification a été envoyée. Ouvrez ${app_name} sur l’un de vos autres appareils pour accepter et commencer la vérification.</string> <!-- Tchap: Use custom string -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

<!-- Verification -->
<string name="tchap_verification_conclusion_not_secure">La vérification de votre nouvelle session a échoué.</string>
<string name="tchap_verification_get_help">Obtenir de l’aide</string>

<!-- Connectivity -->
<string name="tchap_no_connection_service_status">Voir l’état du service</string>
Expand Down
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2688,7 +2688,7 @@
<string name="failed_to_access_secure_storage">Failed to access secure storage</string>
<string name="bad_passphrase_key_reset_all_action">Lost your Recovery Code? Generate a new one.</string><!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all">Reset everything</string>
<string name="secure_backup_reset_all_no_other_devices">Only do this if you have no other device you can verify this device with.</string>
<string name="secure_backup_reset_all_no_other_devices">Only do this if you lost your recovery code and you have no other device connected to ${app_name}.</string><!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all_no_other_devices_long">Resetting your verification keys cannot be undone. After resetting, you won\'t have access to old encrypted messages, and any friends who have previously verified you will see security warnings until you re-verify with them.</string>
<!-- TODO TO BE REMOVED -->
<string tools:ignore="UnusedResources" name="secure_backup_reset_if_you_reset_all">If you reset everything</string>
Expand Down
1 change: 1 addition & 0 deletions library/ui-strings/src/main/res/values/strings_tchap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

<!-- Verification -->
<string name="tchap_verification_conclusion_not_secure">Failed to verify your new session.</string>
<string name="tchap_verification_get_help">Get help</string>

<!-- Connectivity -->
<string name="tchap_no_connection_service_status">View the status of services</string>
Expand Down
36 changes: 24 additions & 12 deletions tools/release/download_github_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import re
# Run `pip3 install requests` if not installed yet
import requests
# Run `pip3 install tqdm` if not installed yet
from tqdm import tqdm

# This script downloads artifacts from GitHub.
# Ref: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact
Expand Down Expand Up @@ -131,20 +133,30 @@

target = targetDir + "/" + filename
sizeInBytes = data.get("size_in_bytes")

# get request
response = requests.get(url, headers=headers, stream=True)

# Sizes in bytes.
total_size = data.get("size_in_bytes")
block_size = 1024

print("Downloading %s to '%s' (file size is %s bytes, this may take a while)..." % (filename, targetDir, sizeInBytes))
if not args.simulate:
# open file to write in binary mode
with open(target, "wb") as file:
# get request
response = requests.get(url, headers=headers)
# write to file
file.write(response.content)
print("Verifying file size...")
# get the file size
size = os.path.getsize(target)
if sizeInBytes != size:
# error = True
print("Warning, file size mismatch: expecting %s and get %s. This is just a warning for now..." % (sizeInBytes, size))
with tqdm(total=total_size, unit="B", unit_scale=True) as progress_bar:
# open file to write in binary mode
with open(target, "wb") as file:
for data in response.iter_content(block_size):
progress_bar.update(len(data))
# write to file
file.write(data)

print("Verifying file size...")
# get the file size
size = os.path.getsize(target)
if sizeInBytes != size:
# error = True
print("Warning, file size mismatch: expecting %s and get %s. This is just a warning for now..." % (sizeInBytes, size))

if error:
print("❌ Error(s) occurred, please check the log")
Expand Down
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.towncrier]
version = "2.14.0"
version = "2.13.8"
directory = "changelog.d"
filename = "TCHAP_CHANGES.md"
name = "Changes in Tchap"
Expand Down
4 changes: 2 additions & 2 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ knit {

// Note: 2 digits max for each value
ext.versionMajor = 2
ext.versionMinor = 14
ext.versionMinor = 13
// 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 = 0
ext.versionPatch = 8

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down
2 changes: 2 additions & 0 deletions vector-config/src/tchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<string-array name="tchap_is_visio_supported_homeservers" translatable="false">
<item>agent.dinum.tchap.gouv.fr</item>
<item>agent.education.tchap.gouv.fr</item>
<item>agent.tchap.gouv.fr</item>
<item>agent.intradef.tchap.gouv.fr</item>
</string-array>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class DefaultErrorFormatter @Inject constructor(
throwable.error.code == MatrixError.M_PASSWORD_NO_SYMBOL -> {
stringProvider.getString(CommonStrings.tchap_register_pwd_no_symbol)
}
throwable.error.code == MatrixError.M_UNKNOWN &&
// TCHAP Add explicit error when a user is not allowed to access a room.
(throwable.error.code == MatrixError.M_UNKNOWN || throwable.error.code == MatrixError.M_FORBIDDEN) &&
throwable.error.message == "Not allowed to join this room" -> {
stringProvider.getString(CommonStrings.room_error_access_unauthorized)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class SelfVerificationController @Inject constructor(
) : BaseEpoxyVerificationController(stringProvider, colorProvider, eventHtmlRenderer) {

interface InteractionListener : BaseEpoxyVerificationController.InteractionListener {
fun onClickHelp()
fun onClickRecoverFromPassphrase()
fun onClickSkip()
fun onClickResetSecurity()
Expand Down Expand Up @@ -320,6 +321,15 @@ class SelfVerificationController @Inject constructor(
listener { host.selfVerificationListener?.onClickResetSecurity() }
}

bottomSheetVerificationActionItem {
id("help")
title(host.stringProvider.getString(CommonStrings.tchap_verification_get_help))
titleColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorError))
iconRes(R.drawable.ic_arrow_right)
iconColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorError))
listener { host.selfVerificationListener?.onClickHelp() }
}

if (!state.isVerificationRequired) {
bottomSheetDividerItem {
id("reset_div")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.PERMISSIONS_FOR_TAKING_PHOTO
import im.vector.app.core.utils.checkPermissions
import im.vector.app.core.utils.onPermissionDeniedDialog
import im.vector.app.core.utils.openUrlInChromeCustomTab
import im.vector.app.core.utils.registerForPermissionsResult
import im.vector.app.databinding.BottomSheetVerificationChildFragmentBinding
import im.vector.app.features.crypto.verification.VerificationAction
import im.vector.app.features.qrcode.QrCodeScannerActivity
import im.vector.app.features.settings.VectorSettingsUrls
import im.vector.lib.strings.CommonStrings
import org.matrix.android.sdk.api.session.crypto.verification.EVerificationState
import timber.log.Timber
Expand Down Expand Up @@ -94,6 +96,10 @@ class SelfVerificationFragment : VectorBaseFragment<BottomSheetVerificationChild
controller.update(state)
}

override fun onClickHelp() {
openUrlInChromeCustomTab(requireContext(), null, TCHAP_FAQ_VERIFICATION_URL)
}

override fun onClickRecoverFromPassphrase() {
viewModel.handle(VerificationAction.VerifyFromPassphrase)
}
Expand Down Expand Up @@ -235,4 +241,9 @@ class SelfVerificationFragment : VectorBaseFragment<BottomSheetVerificationChild
}
}
}

companion object {
private const val TCHAP_FAQ_VERIFICATION_URL =
"${VectorSettingsUrls.HELP}/fr/article/comment-verifier-un-nouvel-appareil-sur-tchap-xm0b0y/"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import im.vector.app.features.home.room.detail.timeline.helper.MessageItemAttrib
import im.vector.app.features.home.room.detail.timeline.item.MessageTextItem_
import im.vector.app.features.home.room.detail.timeline.tools.createLinkMovementMethod
import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.settings.VectorSettingsUrls
import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
import im.vector.lib.strings.CommonStrings
import me.gujun.android.span.image
Expand Down Expand Up @@ -139,6 +140,6 @@ class EncryptedItemFactory @Inject constructor(

companion object {
private const val TCHAP_FAQ_UTD_URL =
"https://aide.tchap.beta.gouv.fr/fr/article/dechiffrement-impossible-de-mes-messages-comment-y-remedier-android-m6e371/"
"${VectorSettingsUrls.HELP}/fr/article/dechiffrement-impossible-de-mes-messages-comment-y-remedier-android-m6e371/"
}
}

0 comments on commit 454ca1d

Please sign in to comment.