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 } } 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) ) } 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