mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 22:02:54 +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 {
|
return {
|
||||||
sign:
|
sign:
|
||||||
typeof capabilities.sign === "boolean"
|
(typeof capabilities.sign === "boolean" && capabilities.sign) ||
|
||||||
? capabilities.sign
|
typeof signer.signEvent === "function",
|
||||||
: typeof signer.signEvent === "function",
|
|
||||||
nip44:
|
nip44:
|
||||||
typeof capabilities.nip44 === "boolean"
|
(typeof capabilities.nip44 === "boolean" && capabilities.nip44) ||
|
||||||
? capabilities.nip44
|
typeof signer.nip44Encrypt === "function" ||
|
||||||
: typeof signer.nip44Encrypt === "function" ||
|
typeof signer.nip44Decrypt === "function",
|
||||||
typeof signer.nip44Decrypt === "function",
|
|
||||||
nip04:
|
nip04:
|
||||||
typeof capabilities.nip04 === "boolean"
|
(typeof capabilities.nip04 === "boolean" && capabilities.nip04) ||
|
||||||
? capabilities.nip04
|
typeof signer.nip04Encrypt === "function" ||
|
||||||
: typeof signer.nip04Encrypt === "function" ||
|
typeof signer.nip04Decrypt === "function",
|
||||||
typeof signer.nip04Decrypt === "function",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user