nip4e: fix message encryption and sync #57

Merged
reya merged 10 commits from fix-nip4e into master 2026-10-04 06:33:33 +00:00
Showing only changes of commit 417829dbe9 - Show all commits
+4 -3
View File
@@ -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?;