This commit is contained in:
Vitor Pamplona
2024-09-05 08:37:15 -04:00
parent 20bf4dbc29
commit c4c542c739
2 changed files with 4 additions and 5 deletions

View File

@@ -32,7 +32,6 @@ import com.vitorpamplona.quartz.encoders.HexKey
import com.vitorpamplona.quartz.encoders.Nip47WalletConnect
import com.vitorpamplona.quartz.encoders.RelayUrlFormatter
import com.vitorpamplona.quartz.encoders.toHexKey
import com.vitorpamplona.quartz.encoders.toNpub
import com.vitorpamplona.quartz.events.AdvertisedRelayListEvent
import com.vitorpamplona.quartz.events.ChatMessageRelayListEvent
import com.vitorpamplona.quartz.events.ContactListEvent
@@ -162,7 +161,7 @@ class AccountSettings(
} else {
when (val packageName = externalSignerPackageName) {
null -> NostrSignerInternal(keyPair)
else -> NostrSignerExternal(keyPair.pubKey.toHexKey(), ExternalSignerLauncher(keyPair.pubKey.toNpub(), packageName))
else -> NostrSignerExternal(keyPair.pubKey.toHexKey(), ExternalSignerLauncher(keyPair.pubKey.toHexKey(), packageName))
}
}

View File

@@ -92,7 +92,7 @@ class Result(
}
class ExternalSignerLauncher(
private val npub: String,
private val currentUserPubKeyHex: String,
val signerPackageName: String,
) {
private val contentCache = LruCache<String, (String) -> Unit>(50)
@@ -222,7 +222,7 @@ class ExternalSignerLauncher(
intent.putExtra("pubKey", pubKey)
intent.putExtra("id", id)
if (type !== SignerType.GET_PUBLIC_KEY) {
intent.putExtra("current_user", npub)
intent.putExtra("current_user", currentUserPubKeyHex)
} else {
intent.putExtra("permissions", defaultPermissions())
}
@@ -278,7 +278,7 @@ class ExternalSignerLauncher(
): kotlin.Result<String?> {
val localData =
if (signerType !== SignerType.GET_PUBLIC_KEY) {
arrayOf(*data, npub)
arrayOf(*data, currentUserPubKeyHex)
} else {
data
}