From b5a0d65f3c37bfdf2d21fc2834ed65a2b24a96c9 Mon Sep 17 00:00:00 2001 From: jiftechnify Date: Tue, 26 Sep 2023 00:49:00 +0900 Subject: [PATCH 1/3] fix contact link in relay information dialog --- .../amethyst/ui/actions/RelayInformationDialog.kt | 10 +++++++++- .../amethyst/ui/components/ClickableEmail.kt | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/RelayInformationDialog.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/RelayInformationDialog.kt index ad1f6fde1..63f5f8acf 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/RelayInformationDialog.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/RelayInformationDialog.kt @@ -111,7 +111,15 @@ fun RelayInformationDialog( Section(stringResource(R.string.contact)) Box(modifier = Modifier.padding(start = 10.dp)) { - ClickableEmail(relayInfo.contact ?: "") + relayInfo.contact?.let { + if (it.startsWith("https:")) { + ClickableUrl(urlText = it, url = it) + } else if (it.startsWith("mailto:") || it.contains('@')) { + ClickableEmail(it) + } else { + SectionContent(it) + } + } } Section(stringResource(R.string.supports)) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableEmail.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableEmail.kt index e3d02c040..4b7e7fc45 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableEmail.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableEmail.kt @@ -13,11 +13,12 @@ import androidx.compose.ui.text.AnnotatedString @Composable fun ClickableEmail(email: String) { + val stripped = email.replaceFirst("mailto:", "") val context = LocalContext.current ClickableText( - text = remember { AnnotatedString(email) }, - onClick = { runCatching { context.sendMail(email) } }, + text = remember { AnnotatedString(stripped) }, + onClick = { runCatching { context.sendMail(stripped) } }, style = LocalTextStyle.current.copy(color = MaterialTheme.colors.primary) ) } From 52f600485b16421613c5e3cedb422c6c7de33200 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Mon, 25 Sep 2023 14:55:44 -0300 Subject: [PATCH 2/3] add notifications for users of amber --- .../service/notifications/EventNotificationConsumer.kt | 1 + .../amethyst/service/notifications/RegisterAccounts.kt | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt b/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt index be6db3e55..275b834c8 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/EventNotificationConsumer.kt @@ -43,6 +43,7 @@ class EventNotificationConsumer(private val applicationContext: Context) { private suspend fun consumeIfMatchesAccount(pushWrappedEvent: GiftWrapEvent, account: Account) { val key = account.keyPair.privKey if (account.loginWithExternalSigner) { + ExternalSignerUtils.account = account var cached = ExternalSignerUtils.cachedDecryptedContent[pushWrappedEvent.id] if (cached == null) { ExternalSignerUtils.decrypt( diff --git a/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/RegisterAccounts.kt b/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/RegisterAccounts.kt index f7c061e02..3e6ecdcd4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/RegisterAccounts.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/RegisterAccounts.kt @@ -4,6 +4,7 @@ import android.util.Log import com.vitorpamplona.amethyst.AccountInfo import com.vitorpamplona.amethyst.BuildConfig import com.vitorpamplona.amethyst.LocalPreferences +import com.vitorpamplona.amethyst.service.ExternalSignerUtils import com.vitorpamplona.amethyst.service.HttpClient import com.vitorpamplona.quartz.events.RelayAuthEvent import kotlinx.coroutines.Dispatchers @@ -23,7 +24,10 @@ class RegisterAccounts( ): List { return accounts.mapNotNull { val acc = LocalPreferences.loadFromEncryptedStorage(it.npub) - if (acc != null && acc.isWriteable()) { + if (acc != null && (acc.isWriteable() || acc.loginWithExternalSigner)) { + if (acc.loginWithExternalSigner) { + ExternalSignerUtils.account = acc + } val relayToUse = acc.activeRelays()?.firstOrNull { it.read } if (relayToUse != null) { acc.createAuthEvent(relayToUse, notificationToken) @@ -66,5 +70,6 @@ class RegisterAccounts( postRegistrationEvent( signEventsToProveControlOfAccounts(accounts, notificationToken) ) + PushNotificationUtils.hasInit = true } } From d92e30dba322b8222469a07781c70f8a8b609a95 Mon Sep 17 00:00:00 2001 From: Crowdin Bot Date: Mon, 25 Sep 2023 18:22:35 +0000 Subject: [PATCH 3/3] New Crowdin translations by GitHub Action --- app/src/main/res/values-fr/strings.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 8661a8709..5f237e424 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -430,6 +430,8 @@ Prévisualisation des images Lecture vidéo Prévisualisation des URLs + Défilement immersif + Masquer les barres de navigation lors du défilement Charger l\'image Spammeurs Silencieux. Cliquer pour réactiver le son @@ -458,6 +460,7 @@ Membres de ce groupe Explication aux membres Changement de nom pour les nouveaux objectifs. + Coller depuis le presse-papiers Pour l\'interface de l\'App Sombre, Clair ou thème Système Charger automatiquement les images et les GIFs @@ -468,6 +471,7 @@ Copier l\'ID de la note dans le presse-papiers Créé le Règles + Se connecter avec Amber Mettez à jour votre statut Erreur d\'analyse du message d\'erreur Les votes sont pondérés par le montant du zap. Vous pouvez définir un montant minimum pour éviter les spammeurs et un montant maximum pour éviter qu\'un grand nombre de zappeurs ne prenne le contrôle du sondage. Utilisez le même montant dans les deux champs pour vous assurer que chaque vote a la même valeur. Laissez le champ vide pour accepter n\'importe quel montant. @@ -496,4 +500,10 @@ Portefeuilles Lightning introuvables Payé Portefeuille %1$s + Erreur lors de l\'ouverture de l\'application de signature + Demande de signature rejetée + Aucun portefeuille trouvé pour payer une facture lightning (Erreur : %1$s). Veuillez installer un portefeuille Lightning pour utiliser les zaps + Aucun portefeuille trouvé pour payer une facture lightning. Veuillez installer un portefeuille Lightning pour utiliser les zaps + Mots Masqués + Masquer un nouveau mot ou une phrase