only seal gift wraps when the receiver announced encryption support
This commit is contained in:
@@ -626,9 +626,10 @@ where
|
||||
rumor.ensure_id();
|
||||
|
||||
let rumor_json = rumor.as_json();
|
||||
let has_encryption_announcement = receiver.announcement().is_some();
|
||||
|
||||
let seal: Event = match encryption_signer {
|
||||
Some(encryption_signer) => {
|
||||
let seal: Event = match (encryption_signer, has_encryption_announcement) {
|
||||
(Some(encryption_signer), true) => {
|
||||
let encryption_pubkey = encryption_signer.get_public_key_async().await?;
|
||||
let content = encryption_signer
|
||||
.nip44_encrypt_async(&receiver_key, &rumor_json)
|
||||
@@ -640,7 +641,7 @@ where
|
||||
.finalize_async(user_signer)
|
||||
.await?
|
||||
}
|
||||
None => {
|
||||
_ => {
|
||||
let content = user_signer
|
||||
.nip44_encrypt_async(&receiver_key, &rumor_json)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user