From 1794c01f56dc50fc33f22d5864bde0a2ee25b162 Mon Sep 17 00:00:00 2001 From: Schmiddiii Date: Mon, 3 Jun 2024 19:34:17 +0200 Subject: [PATCH] Decode device name --- presage/Cargo.toml | 4 ++-- presage/src/manager/registered.rs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/presage/Cargo.toml b/presage/Cargo.toml index 4db0ffa7b..e8c90fe22 100644 --- a/presage/Cargo.toml +++ b/presage/Cargo.toml @@ -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" diff --git a/presage/src/manager/registered.rs b/presage/src/manager/registered.rs index 3ffe9a6be..4946dc1c3 100644 --- a/presage/src/manager/registered.rs +++ b/presage/src/manager/registered.rs @@ -1269,14 +1269,20 @@ impl Manager { Ok(()) } - /// As a primary device, list all the devices. - // XXX: Also shows the current device? - pub async fn linked_devices(&self) -> Result, Error> { + /// As a primary device, list all the devices (uncluding the current device). + pub async fn devices(&self) -> Result, 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::::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