mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
fix(nostr): correctly resolve signer capabilities when methods are present
This fixes a critical issue where valid NIP-07 signers were treated as incapable of NIP-44/NIP-04 operations if their initial `capabilities` flag was false, even if the necessary methods (e.g., `nip44Decrypt`) were subsequently added or already present. This addresses errors like "Gift wrap events require a NIP-44 decryptor" for users with valid extensions. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
35698340a8
commit
730618efa8
1 file changed
+8
-11
+8
-11
@@ -307,19 +307,16 @@ function resolveSignerCapabilities(signer) {
|
||||
|
||||
return {
|
||||
sign:
|
||||
typeof capabilities.sign === "boolean"
|
||||
? capabilities.sign
|
||||
: typeof signer.signEvent === "function",
|
||||
(typeof capabilities.sign === "boolean" && capabilities.sign) ||
|
||||
typeof signer.signEvent === "function",
|
||||
nip44:
|
||||
typeof capabilities.nip44 === "boolean"
|
||||
? capabilities.nip44
|
||||
: typeof signer.nip44Encrypt === "function" ||
|
||||
typeof signer.nip44Decrypt === "function",
|
||||
(typeof capabilities.nip44 === "boolean" && capabilities.nip44) ||
|
||||
typeof signer.nip44Encrypt === "function" ||
|
||||
typeof signer.nip44Decrypt === "function",
|
||||
nip04:
|
||||
typeof capabilities.nip04 === "boolean"
|
||||
? capabilities.nip04
|
||||
: typeof signer.nip04Encrypt === "function" ||
|
||||
typeof signer.nip04Decrypt === "function",
|
||||
(typeof capabilities.nip04 === "boolean" && capabilities.nip04) ||
|
||||
typeof signer.nip04Encrypt === "function" ||
|
||||
typeof signer.nip04Decrypt === "function",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user