add screener card

This commit is contained in:
2026-06-18 14:38:23 +07:00
parent 7a31749b4f
commit cde3df98f2
9 changed files with 204 additions and 136 deletions

View File

@@ -296,7 +296,7 @@ class Nostr {
if (event.kind().asStd()?.equals(KindStandard.CONTACT_LIST) == true) {
if (isSignedByUser(event = event)) {
val pubkeys = event.tags().publicKeys();
val pubkeys = event.tags().publicKeys()
// Get mutual contacts
getMutualContacts(pubkeys)
// Emit contact list update
@@ -367,7 +367,7 @@ class Nostr {
private suspend fun getMutualContacts(pubkeys: List<PublicKey>) {
try {
val kind = Kind.fromStd(KindStandard.CONTACT_LIST);
val kind = Kind.fromStd(KindStandard.CONTACT_LIST)
val filter = Filter().kind(kind).authors(pubkeys).limit(200u)
val opts = SubscribeAutoCloseOptions().exitPolicy(ReqExitPolicy.ExitOnEose)
@@ -974,17 +974,6 @@ class Nostr {
}
}
suspend fun verifyAddress(pubkey: PublicKey, address: String): Boolean {
try {
val address = Nip05Address.parse(address)
val profile = profileFromAddress(HttpClient(), address)
return profile.publicKey() == pubkey
} catch (e: Exception) {
throw IllegalStateException("Failed to verify address: ${e.message}", e)
}
}
suspend fun verifyActivity(pubkey: PublicKey): Timestamp? {
try {
val filter = Filter().author(pubkey).limit(3u)

View File

@@ -821,16 +821,7 @@ class NostrViewModel(
}
return emptyList()
}
suspend fun verifyAddress(pubkey: PublicKey, address: String): Boolean {
return try {
nostr.verifyAddress(pubkey, address)
} catch (e: Exception) {
showError("Error: ${e.message}")
false
}
}
suspend fun verifyActivity(pubkey: PublicKey): Timestamp? {
return try {
nostr.verifyActivity(pubkey)