Skip to content

Commit

Permalink
Decode device name
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmiddiii committed Jun 3, 2024
1 parent a1dda1c commit 01d0e5c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions presage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
license = "AGPL-3.0-only"

[dependencies]
libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "26c036e" }
libsignal-service-hyper = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "26c036e" }
libsignal-service = { git = "https://github.com/Schmiddiii/libsignal-service-rs", rev = "d2a0d987b7e77f67660893cdbb8f2f1ecbe118d9" }
libsignal-service-hyper = { git = "https://github.com/Schmiddiii/libsignal-service-rs", rev = "d2a0d987b7e77f67660893cdbb8f2f1ecbe118d9" }

base64 = "0.21"
futures = "0.3"
Expand Down
19 changes: 18 additions & 1 deletion presage/src/manager/registered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,24 @@ impl<S: Store> Manager<S, Registered> {
if self.registration_type() != RegistrationType::Primary {
return Err(Error::<S::Error>::NotPrimaryDevice);
}
Ok(self.identified_push_service().devices().await?)

let device_infos = self.identified_push_service().devices().await?;

let aci_protocol_store = self.store.aci_protocol_store();
let aci_identity_keypair = aci_protocol_store.get_identity_key_pair().await?;
let aci_private_key = aci_identity_keypair.private_key();

device_infos
.into_iter()
.map(|i| {
Ok(DeviceInfo {
id: i.id,
name: i.decrypt_device_name(&aci_private_key)?,
created: i.created,
last_seen: i.last_seen,
})
})
.collect()
}

/// Deprecated methods
Expand Down

0 comments on commit 01d0e5c

Please sign in to comment.