Merge pull request #2785 from greenart7c3/claude/disable-client-tags-option-Nb3b4
Add option to disable NIP-89 client tag in published events
This commit is contained in:
+13
-1
@@ -40,12 +40,19 @@ import com.vitorpamplona.quartz.nip57Zaps.LnZapRequestEvent
|
||||
class NostrSignerWithClientTag(
|
||||
val inner: NostrSigner,
|
||||
val clientTag: Array<String>,
|
||||
val disabled: () -> Boolean = { false },
|
||||
) : NostrSigner(inner.pubKey) {
|
||||
constructor(
|
||||
inner: NostrSigner,
|
||||
clientName: String,
|
||||
) : this(inner, ClientTag.assemble(clientName))
|
||||
|
||||
constructor(
|
||||
inner: NostrSigner,
|
||||
clientName: String,
|
||||
disabled: () -> Boolean,
|
||||
) : this(inner, ClientTag.assemble(clientName), disabled)
|
||||
|
||||
constructor(
|
||||
inner: NostrSigner,
|
||||
clientName: String,
|
||||
@@ -60,7 +67,12 @@ class NostrSignerWithClientTag(
|
||||
kind: Int,
|
||||
tags: Array<Array<String>>,
|
||||
content: String,
|
||||
): T = inner.sign(createdAt, kind, appendClientTag(tags), content)
|
||||
): T =
|
||||
if (disabled()) {
|
||||
inner.sign(createdAt, kind, tags, content)
|
||||
} else {
|
||||
inner.sign(createdAt, kind, appendClientTag(tags), content)
|
||||
}
|
||||
|
||||
override suspend fun nip04Encrypt(
|
||||
plaintext: String,
|
||||
|
||||
Reference in New Issue
Block a user