From e35296c9b36e044055b99664ef3f3a93802a0027 Mon Sep 17 00:00:00 2001 From: Andrew Bulhak Date: Thu, 28 Nov 2024 15:37:36 +0100 Subject: [PATCH] Replace misspelling of WireGuardObfuscationShadowsocksPort type name --- ios/MullvadREST/Relay/ObfuscatorPortSelector.swift | 2 +- ios/MullvadSettings/WireGuardObfuscationSettings.swift | 8 ++++---- .../Obfuscation/ShadowsocksObfuscationSettingsView.swift | 4 ++-- .../ShadowsocksObfuscationSettingsViewModel.swift | 8 ++++---- .../VPNSettings/VPNSettingsViewModel.swift | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ios/MullvadREST/Relay/ObfuscatorPortSelector.swift b/ios/MullvadREST/Relay/ObfuscatorPortSelector.swift index 152cf6b638f6..e6ca92f4f78b 100644 --- a/ios/MullvadREST/Relay/ObfuscatorPortSelector.swift +++ b/ios/MullvadREST/Relay/ObfuscatorPortSelector.swift @@ -59,7 +59,7 @@ struct ObfuscatorPortSelector { private func filterShadowsocksRelays( from relays: REST.ServerRelaysResponse, - for port: WireGuardObfuscationShadowsockPort + for port: WireGuardObfuscationShadowsocksPort ) -> REST.ServerRelaysResponse { let portRanges = RelaySelector.parseRawPortRanges(relays.wireguard.shadowsocksPortRanges) diff --git a/ios/MullvadSettings/WireGuardObfuscationSettings.swift b/ios/MullvadSettings/WireGuardObfuscationSettings.swift index e8679fb0c407..f067114cc634 100644 --- a/ios/MullvadSettings/WireGuardObfuscationSettings.swift +++ b/ios/MullvadSettings/WireGuardObfuscationSettings.swift @@ -81,7 +81,7 @@ public enum WireGuardObfuscationUdpOverTcpPort: Codable, Equatable, CustomString } } -public enum WireGuardObfuscationShadowsockPort: Codable, Equatable, CustomStringConvertible { +public enum WireGuardObfuscationShadowsocksPort: Codable, Equatable, CustomStringConvertible { case automatic case custom(UInt16) @@ -126,12 +126,12 @@ public struct WireGuardObfuscationSettings: Codable, Equatable { public var state: WireGuardObfuscationState public var udpOverTcpPort: WireGuardObfuscationUdpOverTcpPort - public var shadowsocksPort: WireGuardObfuscationShadowsockPort + public var shadowsocksPort: WireGuardObfuscationShadowsocksPort public init( state: WireGuardObfuscationState = .automatic, udpOverTcpPort: WireGuardObfuscationUdpOverTcpPort = .automatic, - shadowsocksPort: WireGuardObfuscationShadowsockPort = .automatic + shadowsocksPort: WireGuardObfuscationShadowsocksPort = .automatic ) { self.state = state self.udpOverTcpPort = udpOverTcpPort @@ -143,7 +143,7 @@ public struct WireGuardObfuscationSettings: Codable, Equatable { state = try container.decode(WireGuardObfuscationState.self, forKey: .state) shadowsocksPort = try container.decodeIfPresent( - WireGuardObfuscationShadowsockPort.self, + WireGuardObfuscationShadowsocksPort.self, forKey: .shadowsocksPort ) ?? .automatic diff --git a/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift b/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift index 3c402a860519..e5434b06e701 100644 --- a/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift +++ b/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift @@ -22,7 +22,7 @@ struct ShadowsocksObfuscationSettingsView: View where VM: ShadowsocksObfusca SingleChoiceList( title: portString, - options: [WireGuardObfuscationShadowsockPort.automatic], + options: [WireGuardObfuscationShadowsocksPort.automatic], value: $viewModel.value, itemDescription: { item in NSLocalizedString( "SHADOWSOCKS_PORT_VALUE_\(item)", @@ -30,7 +30,7 @@ struct ShadowsocksObfuscationSettingsView: View where VM: ShadowsocksObfusca value: "\(item)", comment: "" ) }, - parseCustomValue: { UInt16($0).flatMap { $0 > 0 ? WireGuardObfuscationShadowsockPort.custom($0) : nil } + parseCustomValue: { UInt16($0).flatMap { $0 > 0 ? WireGuardObfuscationShadowsocksPort.custom($0) : nil } }, formatCustomValue: { if case let .custom(port) = $0 { diff --git a/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsViewModel.swift b/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsViewModel.swift index 4d917496a6b0..b0a4aa3eab75 100644 --- a/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsViewModel.swift +++ b/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsViewModel.swift @@ -10,16 +10,16 @@ import Foundation import MullvadSettings protocol ShadowsocksObfuscationSettingsViewModel: ObservableObject { - var value: WireGuardObfuscationShadowsockPort { get set } + var value: WireGuardObfuscationShadowsocksPort { get set } func commit() } /** A simple mock view model for use in Previews and similar */ class MockShadowsocksObfuscationSettingsViewModel: ShadowsocksObfuscationSettingsViewModel { - @Published var value: WireGuardObfuscationShadowsockPort + @Published var value: WireGuardObfuscationShadowsocksPort - init(shadowsocksPort: WireGuardObfuscationShadowsockPort = .automatic) { + init(shadowsocksPort: WireGuardObfuscationShadowsocksPort = .automatic) { self.value = shadowsocksPort } @@ -28,7 +28,7 @@ class MockShadowsocksObfuscationSettingsViewModel: ShadowsocksObfuscationSetting /// ** The live view model which interfaces with the TunnelManager */ class TunnelShadowsocksObfuscationSettingsViewModel: TunnelObfuscationSettingsWatchingObservableObject< - WireGuardObfuscationShadowsockPort + WireGuardObfuscationShadowsocksPort >, ShadowsocksObfuscationSettingsViewModel { init(tunnelManager: TunnelManager) { diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewModel.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewModel.swift index c2d8788ce355..ae18c6a0346d 100644 --- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewModel.swift +++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewModel.swift @@ -98,7 +98,7 @@ struct VPNSettingsViewModel: Equatable { private(set) var obfuscationState: WireGuardObfuscationState private(set) var obfuscationUpdOverTcpPort: WireGuardObfuscationUdpOverTcpPort - private(set) var obfuscationShadowsocksPort: WireGuardObfuscationShadowsockPort + private(set) var obfuscationShadowsocksPort: WireGuardObfuscationShadowsocksPort private(set) var quantumResistance: TunnelQuantumResistance private(set) var multihopState: MultihopState @@ -179,7 +179,7 @@ struct VPNSettingsViewModel: Equatable { obfuscationState = newState } - mutating func setWireGuardObfuscationShadowsockPort(_ newPort: WireGuardObfuscationShadowsockPort) { + mutating func setWireGuardObfuscationShadowsockPort(_ newPort: WireGuardObfuscationShadowsocksPort) { obfuscationShadowsocksPort = newPort }