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 8, 2024
1 parent a1dda1c commit 1794c01
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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/whisperfish/libsignal-service-rs", rev = "1e04a655c62271ffdfe70b053a6150e0cc2cb155" }
libsignal-service-hyper = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "1e04a655c62271ffdfe70b053a6150e0cc2cb155" }

base64 = "0.21"
futures = "0.3"
Expand Down
14 changes: 10 additions & 4 deletions presage/src/manager/registered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1269,14 +1269,20 @@ impl<S: Store> Manager<S, Registered> {
Ok(())
}

/// As a primary device, list all the devices.
// XXX: Also shows the current device?
pub async fn linked_devices(&self) -> Result<Vec<DeviceInfo>, Error<S::Error>> {
/// As a primary device, list all the devices (uncluding the current device).
pub async fn devices(&self) -> Result<Vec<DeviceInfo>, Error<S::Error>> {
// XXX: What happens if secondary device? Possible to use static typing to make this method call impossible in that case?
if self.registration_type() != RegistrationType::Primary {
return Err(Error::<S::Error>::NotPrimaryDevice);
}
Ok(self.identified_push_service().devices().await?)

let aci_protocol_store = self.store.aci_protocol_store();
let mut account_manager = AccountManager::new(
self.identified_push_service(),
Some(self.state.data.profile_key),
);

Ok(account_manager.linked_devices(&aci_protocol_store).await?)
}

/// Deprecated methods
Expand Down

0 comments on commit 1794c01

Please sign in to comment.