diff --git a/extensions/warp-ipfs/examples/identity-interface.rs b/extensions/warp-ipfs/examples/identity-interface.rs index e3ceb9686..a302cd711 100644 --- a/extensions/warp-ipfs/examples/identity-interface.rs +++ b/extensions/warp-ipfs/examples/identity-interface.rs @@ -46,8 +46,6 @@ struct Opt { #[clap(long)] bootstrap: Option, #[clap(long)] - provide_platform_info: bool, - #[clap(long)] autoaccept_friend: bool, #[clap(long)] wait: Option, @@ -99,8 +97,6 @@ async fn account( config.ipfs_setting_mut().portmapping = true; } - config.store_setting_mut().share_platform = opt.provide_platform_info; - if let Some(oride) = opt.r#override { config.store_setting_mut().fetch_over_bitswap = oride; } diff --git a/extensions/warp-ipfs/examples/messenger.rs b/extensions/warp-ipfs/examples/messenger.rs index b3b52854d..69c25760e 100644 --- a/extensions/warp-ipfs/examples/messenger.rs +++ b/extensions/warp-ipfs/examples/messenger.rs @@ -59,8 +59,6 @@ struct Opt { #[clap(long)] bootstrap: Option, #[clap(long)] - provide_platform_info: bool, - #[clap(long)] wait: Option, #[clap(long)] phrase: Option, @@ -113,8 +111,6 @@ async fn setup>( config.ipfs_setting_mut().portmapping = true; } - config.store_setting_mut().share_platform = opt.provide_platform_info; - if let Some(oride) = opt.r#override { config.store_setting_mut().fetch_over_bitswap = oride; } diff --git a/extensions/warp-ipfs/src/config.rs b/extensions/warp-ipfs/src/config.rs index b55163e19..567e44657 100644 --- a/extensions/warp-ipfs/src/config.rs +++ b/extensions/warp-ipfs/src/config.rs @@ -129,8 +129,6 @@ pub struct StoreSetting { /// Fetch data over bitswap instead of pubsub pub fetch_over_bitswap: bool, - /// Enables sharing platform (Desktop, Mobile, Web) information to another user - pub share_platform: bool, /// Waits for a response from peer for a specific duration pub friend_request_response_duration: Option, /// Disable providing images for identities @@ -156,7 +154,6 @@ impl Default for StoreSetting { discovery_type: Default::default(), }, fetch_over_bitswap: false, - share_platform: false, friend_request_response_duration: None, disable_images: false, with_friends: false, diff --git a/extensions/warp-ipfs/src/store/identity.rs b/extensions/warp-ipfs/src/store/identity.rs index b653d5d8f..f0de1bdca 100644 --- a/extensions/warp-ipfs/src/store/identity.rs +++ b/extensions/warp-ipfs/src/store/identity.rs @@ -999,28 +999,11 @@ impl IdentityStore { let is_blocked_by = self.is_blocked_by(out_did).await.unwrap_or_default(); - let share_platform = self.config.store_setting().share_platform; - - let platform = - (share_platform && (!is_blocked || !is_blocked_by)).then_some(self.own_platform()); - - identity.metadata.platform = platform; - - let mut metadata = identity.metadata; - metadata.platform = platform; + identity.metadata.platform = Some(self.own_platform()); + let metadata = identity.metadata; identity.metadata = Default::default(); - /* - (matches!( - self.config.store_setting().update_events, - UpdateEvents::Enabled - ) || matches!( - self.config.store_setting().update_events, - UpdateEvents::FriendsOnly - ) && is_friend) - && */ - let include_meta = is_friend || (!is_blocked && !is_blocked_by); tracing::debug!(?metadata, included = include_meta); @@ -1626,22 +1609,20 @@ impl IdentityStore { } fn own_platform(&self) -> Platform { - if self.config.store_setting().share_platform { - if cfg!(any( - target_os = "windows", - target_os = "macos", - target_os = "linux", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "openbsd", - target_os = "netbsd" - )) { - Platform::Desktop - } else if cfg!(any(target_os = "android", target_os = "ios")) { - Platform::Mobile - } else { - Platform::Unknown - } + if cfg!(any( + target_os = "windows", + target_os = "macos", + target_os = "linux", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd" + )) { + Platform::Desktop + } else if cfg!(any(target_os = "android", target_os = "ios")) { + Platform::Mobile + } else if cfg!(any(target_arch = "wasm32", target_os = "unknown")) { + Platform::Web } else { Platform::Unknown } diff --git a/extensions/warp-ipfs/tests/common.rs b/extensions/warp-ipfs/tests/common.rs index 730b902eb..eeda53d4b 100644 --- a/extensions/warp-ipfs/tests/common.rs +++ b/extensions/warp-ipfs/tests/common.rs @@ -62,7 +62,6 @@ pub async fn create_account( *config.listen_on_mut() = vec![Multiaddr::empty().with(Protocol::Memory(0))]; config.ipfs_setting_mut().memory_transport = true; config.store_setting_mut().discovery = Discovery::None; - config.store_setting_mut().share_platform = true; config.ipfs_setting_mut().relay_client.relay_address = vec![]; config.ipfs_setting_mut().mdns.enable = false; config.store_setting_mut().announce_to_mesh = true;