Skip to content

Commit

Permalink
MessageSenderError::NotFound: Return ServiceAddress instead of UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
direc85 committed May 25, 2024
1 parent 5bf21ce commit d7aec37
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libsignal-service/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use libsignal_protocol::{
use rand::{CryptoRng, Rng};
use tracing::{info, trace};
use tracing_futures::Instrument;
use uuid::Uuid;

use crate::{
cipher::{get_preferred_protocol_address, ServiceCipher},
Expand Down Expand Up @@ -119,8 +118,8 @@ pub enum MessageSenderError {
#[error("Proof of type {options:?} required using token {token}")]
ProofRequired { token: String, options: Vec<String> },

#[error("Recipient not found: {uuid}")]
NotFound { uuid: Uuid },
#[error("Recipient not found: {addr:?}")]
NotFound { addr: ServiceAddress },
}

impl<Service, S, R> MessageSender<Service, S, R>
Expand Down Expand Up @@ -599,7 +598,7 @@ where
Err(ServiceError::NotFoundError) => {
tracing::debug!("Not found when sending a message");
return Err(MessageSenderError::NotFound {
uuid: recipient.uuid,
addr: recipient,
});
},
Err(e) => {
Expand Down Expand Up @@ -806,7 +805,7 @@ where
},
Err(ServiceError::NotFoundError) => {
return Err(MessageSenderError::NotFound {
uuid: recipient.uuid,
addr: *recipient,
});
},
Err(e) => Err(e)?,
Expand Down

0 comments on commit d7aec37

Please sign in to comment.