Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions wacore/src/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,15 @@ pub async fn prepare_dm_stanza<
includes_prekey_message = includes_prekey_message || result.includes_prekey_message;
}

// All per-device encrypts failed: an empty <participants> would silently
// drop the message. WA Web's encryptAndSendUserMsg rejects here too.
let attempted_devices = recipient_devices.len() + own_other_devices.len();
if participant_nodes.is_empty() && attempted_devices > 0 {
return Err(anyhow!(
"encryption failed for all {attempted_devices} recipient device(s)"
));
}

let mut message_content_nodes = vec![
NodeBuilder::new("participants")
.children(participant_nodes)
Expand Down
Loading