Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace misspelling of WireGuardObfuscationShadowsocksPort type name #7260

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading