Skip to content

Commit

Permalink
Set "Direct only" to false as default
Browse files Browse the repository at this point in the history
For android, it is set to true, as multihop is not supported.

Note that in the daemon, the setting is called
`use_multihop_if_necessary` and has the inverse meaning.
  • Loading branch information
Serock3 committed Oct 7, 2024
1 parent b6cc6e0 commit 26e369b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion mullvad-types/src/wireguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,28 @@ impl FromStr for QuantumResistantState {
pub struct QuantumResistantStateParseError;

#[cfg(daita)]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct DaitaSettings {
pub enabled: bool,

#[serde(default)]
/// 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 Default for DaitaSettings {
fn default() -> Self {
Self {
enabled: false,
// This setting should be enabled by default, expect on Android where multihop is not
// supported.
use_multihop_if_necessary: cfg!(not(target_os = "android")),
}
}
}

/// Contains account specific wireguard data
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct WireguardData {
Expand Down

0 comments on commit 26e369b

Please sign in to comment.