diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-03-04 11:07:04 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-03-04 13:27:22 +0100 |
| commit | 2254454f65d24986beef6eaa5292c01856176e54 (patch) | |
| tree | ad96cf9e455910738895304d64dfc3b957ab1482 | |
| parent | 52ac8fe45a8ec0cb76618e94c1e5271962bad32a (diff) | |
| download | mullvadvpn-2254454f65d24986beef6eaa5292c01856176e54.tar.xz mullvadvpn-2254454f65d24986beef6eaa5292c01856176e54.zip | |
Update daemon+CLI to use new app_version_check
| -rw-r--r-- | mullvad-cli/src/cmds/version.rs | 11 | ||||
| -rw-r--r-- | mullvad-daemon/src/lib.rs | 14 | ||||
| -rw-r--r-- | mullvad-rpc/src/lib.rs | 3 | ||||
| -rw-r--r-- | mullvad-types/src/version.rs | 6 |
4 files changed, 17 insertions, 17 deletions
diff --git a/mullvad-cli/src/cmds/version.rs b/mullvad-cli/src/cmds/version.rs index b255f98c54..136e2a6aa2 100644 --- a/mullvad-cli/src/cmds/version.rs +++ b/mullvad-cli/src/cmds/version.rs @@ -18,9 +18,14 @@ impl Command for Version { println!("Current version: {}", current_version); let version_info = rpc.get_version_info()?; println!("Supported: {}", version_info.current_is_supported); - println!("Latest releases:"); - println!("\tlatest stable: {}", version_info.latest.latest_stable); - println!("\tlatest: {}", version_info.latest.latest); + if version_info.latest_stable != version_info.latest { + println!( + "Latest version: {} (latest stable: {})", + version_info.latest, version_info.latest_stable + ); + } else { + println!("Latest version: {}", version_info.latest_stable); + } Ok(()) } } diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index 2fffb6a8b9..bc7e32dcbc 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -625,14 +625,16 @@ impl Daemon { &mut self, tx: oneshot::Sender<BoxFuture<AppVersionInfo, mullvad_rpc::Error>>, ) { + #[cfg(target_os = "linux")] + const PLATFORM: &str = "linux"; + #[cfg(target_os = "macos")] + const PLATFORM: &str = "macos"; + #[cfg(target_os = "windows")] + const PLATFORM: &str = "windows"; + let fut = self .version_proxy - .latest_app_version() - .join(self.version_proxy.is_app_version_supported(&self.version)) - .map(|(latest_versions, is_supported)| AppVersionInfo { - current_is_supported: is_supported, - latest: latest_versions, - }); + .app_version_check(&self.version, PLATFORM); Self::oneshot_send(tx, Box::new(fut), "get_version_info response"); } diff --git a/mullvad-rpc/src/lib.rs b/mullvad-rpc/src/lib.rs index cde2de539c..0f23a3eba1 100644 --- a/mullvad-rpc/src/lib.rs +++ b/mullvad-rpc/src/lib.rs @@ -127,8 +127,7 @@ jsonrpc_client!(pub struct RelayListProxy { }); jsonrpc_client!(pub struct AppVersionProxy { - pub fn latest_app_version(&mut self) -> RpcRequest<version::LatestReleases>; - pub fn is_app_version_supported(&mut self, version: &version::AppVersion) -> RpcRequest<bool>; + pub fn app_version_check(&mut self, version: &version::AppVersion, platform: &str) -> RpcRequest<version::AppVersionInfo>; }); jsonrpc_client!(pub struct WireguardKeyProxy { diff --git a/mullvad-types/src/version.rs b/mullvad-types/src/version.rs index 16e28734bc..c07e35d5a1 100644 --- a/mullvad-types/src/version.rs +++ b/mullvad-types/src/version.rs @@ -5,12 +5,6 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AppVersionInfo { pub current_is_supported: bool, - pub latest: LatestReleases, -} - -/// LatestReleases represent the latest released versions of the Mullvad VPN app. -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct LatestReleases { pub latest_stable: AppVersion, pub latest: AppVersion, } |
