Skip to content

Commit

Permalink
lint and format - WPB-12100 (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
jullianm committed Nov 27, 2024
1 parent 8c79698 commit 59991d3
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import WireAPI

extension WireAPI.ConversationLabel {

func toDomainModel() -> ConversationLabelInfo {
.init(
id: id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import WireDataModel

public struct UserClientInfo: Sendable {

let id: String
let label: String?
let type: WireDataModel.DeviceType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ final class UserRepositoryTests: XCTestCase {

userLocalStore.isSelfUserIdDomain_MockValue = (user, false)
userLocalStore.markAccountAsDeletedFor_MockMethod = { _ in }

conversationsRepository
.removeParticipantFromAllGroupConversationsParticipantIDParticipantDomainRemovedAt_MockMethod = { _, _, _ in
}
Expand Down Expand Up @@ -440,7 +440,7 @@ final class UserRepositoryTests: XCTestCase {

func testFetchAllUserIdsWithOneOnOneConversation() async throws {
// Given

userLocalStore.fetchAllUserIDsWithOneOnOneConversation_MockValue = [Scaffolding.qualifiedID.toDomainModel()]

// When
Expand Down
2 changes: 1 addition & 1 deletion wire-ios-data-model/Source/MLS/BackendMLSPublicKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public struct BackendMLSPublicKeys: Equatable {
}

public func hasValidKeys() -> Bool {
return [ed25519, ed448, p256, p384, p521].contains { key in
[ed25519, ed448, p256, p384, p521].contains { key in
guard let key else { return false }

return !key.isEmpty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public extension Feature {
public extension Feature.MLS {

var isEnabled: Bool {
return status == .enabled
status == .enabled
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public final class FetchBackendMLSPublicKeysRequestStrategy: AbstractRequestStra
applicationStatus: ApplicationStatus,
syncProgress: SyncProgress
) {
actionHandler = FetchBackendMLSPublicKeysActionHandler(context: managedObjectContext)
actionSync = EntityActionSync(actionHandlers: [actionHandler])
self.actionHandler = FetchBackendMLSPublicKeysActionHandler(context: managedObjectContext)
self.actionSync = EntityActionSync(actionHandlers: [actionHandler])
self.syncStatus = syncProgress

super.init(
Expand Down Expand Up @@ -110,7 +110,7 @@ public final class FetchBackendMLSPublicKeysRequestStrategy: AbstractRequestStra
}
}

self.slowSyncTask = nil
slowSyncTask = nil
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ final class EvaluateOneOnOneConversationsStrategy: AbstractRequestStrategy {
let mlsFeature = await FeatureRepository(context: syncContext).fetchMLS()
let resolver = OneOnOneResolver(
migrator: migrator,
isMLSEnabled: mlsFeature.isEnabled)
isMLSEnabled: mlsFeature.isEnabled
)
try await resolver.resolveAllOneOnOneConversations(in: syncContext)

await syncContext.perform {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public class StrategyDirectory: NSObject, StrategyDirectoryProtocol {
let mlsFeature = FeatureRepository(context: syncMOC).fetchMLS()
let oneOnOneResolver = OneOnOneResolver(
migrator: OneOnOneMigrator(mlsService: mlsService),
isMLSEnabled: mlsFeature.isEnabled)
isMLSEnabled: mlsFeature.isEnabled
)

return [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public class ZMClientRegistrationStatus: NSObject, ClientRegistrationDelegate {
var action = FetchBackendMLSPublicKeysAction()
action.perform(in: managedObjectContext.notificationContext) { [weak self] result in
switch result {
case .success(let backendPublicKeys):
case let .success(backendPublicKeys):
let hasValidKeys = backendPublicKeys.removal.hasValidKeys()
BackendInfo.isMLSEnabled = hasValidKeys
self?.didFetchBackendMLSPublicKeys()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension ZMUserSession {
.init(id: #function, interval: .oneDay) { [weak self] in
guard
let self,
self.mlsFeature.isEnabled else {
mlsFeature.isEnabled else {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,8 @@ extension ZMUserSession: ZMSyncStateDelegate {
let supportedProtocolService = SupportedProtocolsService(context: context)
let resolver = OneOnOneResolver(
migrator: OneOnOneMigrator(mlsService: mlsService),
isMLSEnabled: mlsFeature.isEnabled)
isMLSEnabled: mlsFeature.isEnabled
)

return ResolveOneOnOneConversationsUseCase(
context: context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ final class ZMClientRegistrationStatusTests: MessagingTest {

@objc
private func enableMLS() {
FeatureRepository(context: self.syncMOC).storeMLS(Feature.MLS(status: .enabled))
FeatureRepository(context: syncMOC).storeMLS(Feature.MLS(status: .enabled))
BackendInfo.apiVersion = .v5
BackendInfo.isMLSEnabled = true
}
Expand Down
2 changes: 1 addition & 1 deletion wire-ios-transport/Source/Public/BackendInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum BackendInfo {
case preferredAPIVersion = "PreferredAPIVersion"
case domain = "Domain"
case isFederationEnabled = "IsFederationEnabled"
case isMLSEnabled = "isMLSEnabled"
case isMLSEnabled

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ final class QRCodeScannerViewController: UIViewController, AVCaptureMetadataOutp
let alertController = UIAlertController(
title: "Scanning not supported",
message: "Your device doesn't support QR code scanning.",
preferredStyle: .alert)
preferredStyle: .alert
)
alertController.addAction(UIAlertAction(title: "OK", style: .default))
present(alertController, animated: true)
captureSession = nil
Expand All @@ -89,7 +90,11 @@ final class QRCodeScannerViewController: UIViewController, AVCaptureMetadataOutp
}
}

func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
func metadataOutput(
_ output: AVCaptureMetadataOutput,
didOutput metadataObjects: [AVMetadataObject],
from connection: AVCaptureConnection
) {
captureSession.stopRunning()

if let metadataObject = metadataObjects.first {
Expand All @@ -102,10 +107,10 @@ final class QRCodeScannerViewController: UIViewController, AVCaptureMetadataOutp
}

override var prefersStatusBarHidden: Bool {
return true
true
}

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
.portrait
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ final class ConversationViewController: UIViewController {
let mlsFeature = await userSession.makeGetMLSFeatureUseCase().invoke()
let resolver = OneOnOneResolver(
migrator: OneOnOneMigrator(mlsService: mlsService),
isMLSEnabled: mlsFeature.isEnabled)
isMLSEnabled: mlsFeature.isEnabled
)
let resolvedState = try await resolver.resolveOneOnOneConversation(with: otherUserID, in: syncContext)

if case let .migratedToMLSGroup(identifier) = resolvedState {
Expand Down

0 comments on commit 59991d3

Please sign in to comment.