Skip to content

Commit

Permalink
Set direct only default to false on android
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Dec 9, 2024
1 parent 15fc4f9 commit 1f42df0
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions mullvad-types/src/wireguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,17 @@ pub struct QuantumResistantStateParseError;
pub struct DaitaSettings {
pub enabled: bool,

#[cfg_attr(target_os = "android", serde(skip))]
#[serde(default = "DaitaSettings::default_use_multihop_if_necessary")]
/// Whether to use multihop if the selected relay is not DAITA-compatible. Note that this is
/// the inverse of of "Direct only" in the GUI.
pub use_multihop_if_necessary: bool,
}

#[cfg(daita)]
impl DaitaSettings {
/// This setting should be enabled by default, expect on Android where multihop is not
/// supported.
const fn default_use_multihop_if_necessary() -> bool {
cfg!(not(target_os = "android"))
}
}

#[cfg(daita)]
impl Default for DaitaSettings {
fn default() -> Self {
Self {
enabled: false,
use_multihop_if_necessary: Self::default_use_multihop_if_necessary(),
use_multihop_if_necessary: true,
}
}
}
Expand Down

0 comments on commit 1f42df0

Please sign in to comment.