Skip to content

Commit

Permalink
Also add a guard to send SyncMessage only if is_multi_device is true
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Oct 22, 2024
1 parent 0379bf3 commit da8a074
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ where
) -> SendMessageResult {
let content_body = message.into();
let message_to_self = recipient == &self.local_aci;
let is_multi_device = self.is_multi_device().await;

use crate::proto::data_message::Flags;

Expand All @@ -365,7 +366,7 @@ where
};

// only send a sync message when sending to self and skip the rest of the process
if message_to_self {
if message_to_self && is_multi_device {
debug!("sending note to self");
let sync_message =
Self::create_multi_device_sent_transcript_content(
Expand Down Expand Up @@ -408,7 +409,7 @@ where
_ => false,
};

if needs_sync || self.is_multi_device().await {
if needs_sync || is_multi_device {
debug!("sending multi-device sync message");
let sync_message =
Self::create_multi_device_sent_transcript_content(
Expand Down Expand Up @@ -544,7 +545,7 @@ where
}) = self
.create_encrypted_messages(
&recipient,
unidentified_access.map(|x| &x.certificate),
uDnidentified_access.map(|x| &x.certificate),

Check failure on line 548 in src/sender.rs

View workflow job for this annotation

GitHub Actions / clippy

cannot find value `uDnidentified_access` in this scope

error[E0425]: cannot find value `uDnidentified_access` in this scope --> src/sender.rs:548:21 | 548 | uDnidentified_access.map(|x| &x.certificate), | ^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `unidentified_access`
&content_bytes,
)
.await?
Expand Down

0 comments on commit da8a074

Please sign in to comment.