mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-11 08:06:41 +01:00
Merge branch 'vitorpamplona:main' into profiles-list-management
This commit is contained in:
@@ -117,10 +117,11 @@ class Amethyst : Application() {
|
|||||||
// Connects the NostrClient class with okHttp
|
// Connects the NostrClient class with okHttp
|
||||||
val websocketBuilder =
|
val websocketBuilder =
|
||||||
OkHttpWebSocket.Builder { url ->
|
OkHttpWebSocket.Builder { url ->
|
||||||
|
val useTor = torProxySettingsAnchor.useProxy(url)
|
||||||
if (torProxySettingsAnchor.isDM(url)) {
|
if (torProxySettingsAnchor.isDM(url)) {
|
||||||
okHttpClientForRelaysForDms.getHttpClient(torProxySettingsAnchor.useProxy(url))
|
okHttpClientForRelaysForDms.getHttpClient(useTor)
|
||||||
} else {
|
} else {
|
||||||
okHttpClientForRelays.getHttpClient(torProxySettingsAnchor.useProxy(url))
|
okHttpClientForRelays.getHttpClient(useTor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -341,7 +341,14 @@ fun UpdateZapAmountContent(
|
|||||||
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
clipboardManager.getText()?.let { postViewModel.copyFromClipboard(it.text) }
|
val uri = clipboardManager.getText()?.text
|
||||||
|
try {
|
||||||
|
uri?.let {
|
||||||
|
postViewModel.copyFromClipboard(it)
|
||||||
|
}
|
||||||
|
} catch (e: IllegalArgumentException) {
|
||||||
|
accountViewModel.toastManager.toast(R.string.invalid_nip47_uri_title, R.string.invalid_nip47_uri_description)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -1485,7 +1485,7 @@ class AccountViewModel(
|
|||||||
dvmPublicKey: User,
|
dvmPublicKey: User,
|
||||||
onReady: (event: Note) -> Unit,
|
onReady: (event: Note) -> Unit,
|
||||||
) {
|
) {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
runIOCatching {
|
||||||
account.requestDVMContentDiscovery(dvmPublicKey) {
|
account.requestDVMContentDiscovery(dvmPublicKey) {
|
||||||
onReady(LocalCache.getOrCreateNote(it.id))
|
onReady(LocalCache.getOrCreateNote(it.id))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class TorSettings(
|
|||||||
val externalSocksPort: Int = 9050,
|
val externalSocksPort: Int = 9050,
|
||||||
val onionRelaysViaTor: Boolean = true,
|
val onionRelaysViaTor: Boolean = true,
|
||||||
val dmRelaysViaTor: Boolean = true,
|
val dmRelaysViaTor: Boolean = true,
|
||||||
val newRelaysViaTor: Boolean = true,
|
val newRelaysViaTor: Boolean = false,
|
||||||
val trustedRelaysViaTor: Boolean = false,
|
val trustedRelaysViaTor: Boolean = false,
|
||||||
val urlPreviewsViaTor: Boolean = false,
|
val urlPreviewsViaTor: Boolean = false,
|
||||||
val profilePicsViaTor: Boolean = false,
|
val profilePicsViaTor: Boolean = false,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class TorSettingsFlow(
|
|||||||
val externalSocksPort: MutableStateFlow<Int> = MutableStateFlow(9050),
|
val externalSocksPort: MutableStateFlow<Int> = MutableStateFlow(9050),
|
||||||
val onionRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(true),
|
val onionRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(true),
|
||||||
val dmRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(true),
|
val dmRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(true),
|
||||||
val newRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(true),
|
val newRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
||||||
val trustedRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
val trustedRelaysViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
||||||
val urlPreviewsViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
val urlPreviewsViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
||||||
val profilePicsViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
val profilePicsViaTor: MutableStateFlow<Boolean> = MutableStateFlow(false),
|
||||||
|
|||||||
@@ -787,6 +787,10 @@
|
|||||||
|
|
||||||
<string name="paste_from_clipboard">Paste from clipboard</string>
|
<string name="paste_from_clipboard">Paste from clipboard</string>
|
||||||
|
|
||||||
|
<string name="invalid_nip47_uri_title">Invalid NIP-47 URI</string>
|
||||||
|
<string name="invalid_nip47_uri_description">The URI %1$s is not a valid NIP-47 login URI.</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="language_description">For the App\'s Interface</string>
|
<string name="language_description">For the App\'s Interface</string>
|
||||||
<string name="theme_description">Dark, Light or System theme</string>
|
<string name="theme_description">Dark, Light or System theme</string>
|
||||||
<string name="automatically_load_images_gifs_description">Automatically load images and GIFs</string>
|
<string name="automatically_load_images_gifs_description">Automatically load images and GIFs</string>
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class MetadataEvent(
|
|||||||
lnURL?.let { addIfNotBlank(currentMetadata, Lud06Tag.TAG_NAME, it.trim()) }
|
lnURL?.let { addIfNotBlank(currentMetadata, Lud06Tag.TAG_NAME, it.trim()) }
|
||||||
|
|
||||||
return eventTemplate(KIND, currentMetadata.toString(), createdAt) {
|
return eventTemplate(KIND, currentMetadata.toString(), createdAt) {
|
||||||
alt("User profile for ${currentMetadata.get("name").asText() ?: "Anonymous"}")
|
alt("User profile for ${currentMetadata.get("name")?.asText() ?: "Anonymous"}")
|
||||||
|
|
||||||
// For https://github.com/nostr-protocol/nips/pull/1770
|
// For https://github.com/nostr-protocol/nips/pull/1770
|
||||||
currentMetadata.get(NameTag.TAG_NAME)?.asText()?.let { name(it) }
|
currentMetadata.get(NameTag.TAG_NAME)?.asText()?.let { name(it) }
|
||||||
@@ -132,7 +132,7 @@ class MetadataEvent(
|
|||||||
currentMetadata.get(Lud06Tag.TAG_NAME)?.asText()?.let { lud06(it) }
|
currentMetadata.get(Lud06Tag.TAG_NAME)?.asText()?.let { lud06(it) }
|
||||||
|
|
||||||
twitter?.let { twitterClaim(it) }
|
twitter?.let { twitterClaim(it) }
|
||||||
?: mastodon?.let { mastodonClaim(it) }
|
mastodon?.let { mastodonClaim(it) }
|
||||||
github?.let { githubClaim(it) }
|
github?.let { githubClaim(it) }
|
||||||
|
|
||||||
initializer()
|
initializer()
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ class PayInvoiceSuccessResponse(
|
|||||||
val result: PayInvoiceResultParams? = null,
|
val result: PayInvoiceResultParams? = null,
|
||||||
) : Response("pay_invoice") {
|
) : Response("pay_invoice") {
|
||||||
class PayInvoiceResultParams(
|
class PayInvoiceResultParams(
|
||||||
val preimage: String,
|
val preimage: String? = null,
|
||||||
) {
|
) {
|
||||||
fun countMemory(): Long = pointerSizeInBytes + preimage.bytesUsedInMemory()
|
fun countMemory(): Long = pointerSizeInBytes + (preimage?.bytesUsedInMemory() ?: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun countMemory(): Long = pointerSizeInBytes + (result?.countMemory() ?: 0)
|
override fun countMemory(): Long = pointerSizeInBytes + (result?.countMemory() ?: 0)
|
||||||
@@ -49,8 +49,8 @@ class PayInvoiceErrorResponse(
|
|||||||
val error: PayInvoiceErrorParams? = null,
|
val error: PayInvoiceErrorParams? = null,
|
||||||
) : Response("pay_invoice") {
|
) : Response("pay_invoice") {
|
||||||
class PayInvoiceErrorParams(
|
class PayInvoiceErrorParams(
|
||||||
val code: ErrorType?,
|
val code: ErrorType? = null,
|
||||||
val message: String?,
|
val message: String? = null,
|
||||||
) {
|
) {
|
||||||
fun countMemory(): Long = pointerSizeInBytes + pointerSizeInBytes + (message?.bytesUsedInMemory() ?: 0)
|
fun countMemory(): Long = pointerSizeInBytes + pointerSizeInBytes + (message?.bytesUsedInMemory() ?: 0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user