Skip to content

Commit

Permalink
Replace misspelling of WireGuardObfuscationShadowsocksPort type name
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv authored and buggmagnet committed Dec 2, 2024
1 parent 5e5bc4e commit e35296c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ios/MullvadREST/Relay/ObfuscatorPortSelector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions ios/MullvadSettings/WireGuardObfuscationSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ struct ShadowsocksObfuscationSettingsView<VM>: View where VM: ShadowsocksObfusca

SingleChoiceList(
title: portString,
options: [WireGuardObfuscationShadowsockPort.automatic],
options: [WireGuardObfuscationShadowsocksPort.automatic],
value: $viewModel.value,
itemDescription: { item in NSLocalizedString(
"SHADOWSOCKS_PORT_VALUE_\(item)",
tableName: "Shadowsocks",
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -179,7 +179,7 @@ struct VPNSettingsViewModel: Equatable {
obfuscationState = newState
}

mutating func setWireGuardObfuscationShadowsockPort(_ newPort: WireGuardObfuscationShadowsockPort) {
mutating func setWireGuardObfuscationShadowsockPort(_ newPort: WireGuardObfuscationShadowsocksPort) {
obfuscationShadowsocksPort = newPort
}

Expand Down

0 comments on commit e35296c

Please sign in to comment.