diff --git a/Linphone/Contacts/ContactsManager.swift b/Linphone/Contacts/ContactsManager.swift index 9cb3b0768..84efe85fd 100644 --- a/Linphone/Contacts/ContactsManager.swift +++ b/Linphone/Contacts/ContactsManager.swift @@ -262,7 +262,7 @@ final class ContactsManager: ObservableObject { return imagePath } - func awaitDataWrite(data: Data, name: String, prefix: String,completion: @escaping ((), String) -> Void) { + func awaitDataWrite(data: Data, name: String, prefix: String, completion: @escaping ((), String) -> Void) { let directory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first if directory != nil { diff --git a/Linphone/TelecomManager/ProviderDelegate.swift b/Linphone/TelecomManager/ProviderDelegate.swift index 61443c185..c12cbed92 100644 --- a/Linphone/TelecomManager/ProviderDelegate.swift +++ b/Linphone/TelecomManager/ProviderDelegate.swift @@ -272,7 +272,7 @@ extension ProviderDelegate: CXProviderDelegate { // attempt to resume another one. action.fulfill() } else { - if call?.conference != nil && core.callsNb ?? 0 > 1 {/* + if call?.conference != nil && core.callsNb > 1 {/* try TelecomManager.shared.lc?.enterConference() action.fulfill() NotificationCenter.default.post(name: Notification.Name("LinphoneCallUpdate"), object: self) diff --git a/Linphone/TelecomManager/TelecomManager.swift b/Linphone/TelecomManager/TelecomManager.swift index 0fb2979d4..d21d7c525 100644 --- a/Linphone/TelecomManager/TelecomManager.swift +++ b/Linphone/TelecomManager/TelecomManager.swift @@ -89,7 +89,7 @@ class TelecomManager: ObservableObject { return } - if TelecomManager.callKitEnabled(core: core) {//&& !nextCallIsTransfer != true { + if TelecomManager.callKitEnabled(core: core) {// && !nextCallIsTransfer != true { let uuid = UUID() let name = "outgoingTODO" // FastAddressBook.displayName(for: addr) ?? "unknow" let handle = CXHandle(type: .generic, value: addr?.asStringUriOnly() ?? "") @@ -521,9 +521,9 @@ class TelecomManager: ObservableObject { break } - //AudioRouteUtils.isBluetoothAvailable(core: core) - //AudioRouteUtils.isHeadsetAudioRouteAvailable(core: core) - //AudioRouteUtils.isBluetoothAudioRouteAvailable(core: core) + // AudioRouteUtils.isBluetoothAvailable(core: core) + // AudioRouteUtils.isHeadsetAudioRouteAvailable(core: core) + // AudioRouteUtils.isBluetoothAudioRouteAvailable(core: core) /* let readyForRoutechange = callkitAudioSessionActivated == nil || (callkitAudioSessionActivated == true) diff --git a/Linphone/UI/Call/CallView.swift b/Linphone/UI/Call/CallView.swift index 6b2f1e48f..937595fc3 100644 --- a/Linphone/UI/Call/CallView.swift +++ b/Linphone/UI/Call/CallView.swift @@ -98,10 +98,8 @@ struct CallView: View { Button { options = callViewModel.getAudioRoute() print("audioRouteIsSpeakeraudioRouteIsSpeaker output \(AVAudioSession.sharedInstance().currentRoute.outputs)") - print("audioRouteIsSpeakeraudioRouteIsSpeaker inputs \(AVAudioSession.sharedInstance().availableInputs?.count)") - if AVAudioSession.sharedInstance().availableInputs != nil && !AVAudioSession.sharedInstance().availableInputs!.filter({ $0.portType.rawValue.contains("Bluetooth") }).isEmpty { diff --git a/Linphone/UI/Main/Contacts/Fragments/ContactsListFragment.swift b/Linphone/UI/Main/Contacts/Fragments/ContactsListFragment.swift index 9dc7d0604..41bfc686b 100644 --- a/Linphone/UI/Main/Contacts/Fragments/ContactsListFragment.swift +++ b/Linphone/UI/Main/Contacts/Fragments/ContactsListFragment.swift @@ -98,5 +98,5 @@ struct ContactsListFragment: View { } #Preview { - ContactsListFragment(contactViewModel: ContactViewModel(), contactsListViewModel: ContactsListViewModel(), showingSheet: .constant(false), startCallFunc: {addr in }) + ContactsListFragment(contactViewModel: ContactViewModel(), contactsListViewModel: ContactsListViewModel(), showingSheet: .constant(false), startCallFunc: {_ in }) } diff --git a/Linphone/UI/Main/Contacts/Model/ContactAvatarModel.swift b/Linphone/UI/Main/Contacts/Model/ContactAvatarModel.swift index bfb3f2ae2..1346767aa 100644 --- a/Linphone/UI/Main/Contacts/Model/ContactAvatarModel.swift +++ b/Linphone/UI/Main/Contacts/Model/ContactAvatarModel.swift @@ -66,7 +66,7 @@ class ContactAvatarModel: ObservableObject { func addSubscription() { friendSuscription = self.friend?.publisher?.onPresenceReceived?.postOnMainQueue { (cbValue: (Friend)) in - print("publisherpublisher onLogCollectionUploadStateChanged \(cbValue.address?.asStringUriOnly())") + print("publisherpublisher onLogCollectionUploadStateChanged \(cbValue.address?.asStringUriOnly() ?? "")") self.presenceStatus = cbValue.consolidatedPresence if cbValue.consolidatedPresence == .Online || cbValue.consolidatedPresence == .Busy { diff --git a/Linphone/UI/Main/ContentView.swift b/Linphone/UI/Main/ContentView.swift index 4c81f0c7c..64f63dc5b 100644 --- a/Linphone/UI/Main/ContentView.swift +++ b/Linphone/UI/Main/ContentView.swift @@ -527,7 +527,7 @@ struct ContentView: View { showingDialer: $showingDialer ) .presentationDetents([.medium]) - //.interactiveDismissDisabled() + // .interactiveDismissDisabled() .presentationBackgroundInteraction(.enabled(upThrough: .medium)) } } else { @@ -666,10 +666,10 @@ struct ContentView: View { .transition(.scale.combined(with: .move(edge: .top))) } - //if sharedMainViewModel.displayToast { + // if sharedMainViewModel.displayToast { ToastView() .zIndex(3) - //} + // } } } .overlay { diff --git a/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift b/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift index 310ae3cc6..d08ad626c 100644 --- a/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift +++ b/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift @@ -28,7 +28,7 @@ class HistoryListViewModel: ObservableObject { var callLogsTmp: [CallLog] = [] var callLogsAddressToDelete = "" - var callLogSubscription : AnyCancellable? + var callLogSubscription: AnyCancellable? init() { computeCallLogsList() } diff --git a/Linphone/Utils/Extensions/ConfigExtension.swift b/Linphone/Utils/Extensions/ConfigExtension.swift index 3659c3eae..9d83cd891 100644 --- a/Linphone/Utils/Extensions/ConfigExtension.swift +++ b/Linphone/Utils/Extensions/ConfigExtension.swift @@ -17,8 +17,6 @@ * along with this program. If not, see . */ - - import Foundation import linphonesw @@ -26,10 +24,10 @@ import linphonesw extension Config { - private static var _instance : Config? + private static var _instance: Config? - public func getDouble(section:String, key:String, defaultValue:Double) -> Double { - if (self.hasEntry(section: section, key: key) != 1) { + public func getDouble(section: String, key: String, defaultValue: Double) -> Double { + if self.hasEntry(section: section, key: key) != 1 { return defaultValue } let stringValue = self.getString(section: section, key: key, defaultString: "") @@ -51,7 +49,7 @@ extension Config { static let appGroupName = "group.org.linphone.phone.logs" // Needs to be the same name in App Group (capabilities in ALL targets - app & extensions - content + service), can't be stored in the Config itself the Config needs this value to get created static let teamID = Config.get().getString(section: "app", key: "team_id", defaultString: "") - static let earlymediaContentExtensionCagetoryIdentifier = Config.get().getString(section: "app", key: "extension_category", defaultString: "") + static let earlymediaContentExtCatIdentifier = Config.get().getString(section: "app", key: "extension_category", defaultString: "") // Default values in app static let serveraddress = Config.get().getString(section: "app", key: "server", defaultString: "") diff --git a/Linphone/Utils/Log.swift b/Linphone/Utils/Log.swift index 25aecc8e5..bb4e61cb1 100644 --- a/Linphone/Utils/Log.swift +++ b/Linphone/Utils/Log.swift @@ -84,19 +84,18 @@ class Log: LoggingServiceDelegate { private func output(_ message: String, _ level: Int, _ domain: String = Bundle.main.bundleIdentifier!) { let log = "[\(domain)][\(levelToStrings[level] ?? "Unkown")] \(message)\n" if #available(iOS 10.0, *) { - os_log("%{public}@", type: levelToOSleLogLevel[level] ?? .info,log) + os_log("%{public}@", type: levelToOSleLogLevel[level] ?? .info, log) } else { NSLog(log) } } - func onLogMessageWritten(logService: linphonesw.LoggingService, domain: String, level: linphonesw.LogLevel, message: String) { output(message, level.rawValue, domain) } public class func stackTrace() { - Thread.callStackSymbols.forEach{ print($0) } + Thread.callStackSymbols.forEach { print($0) } } // Debug diff --git a/Linphone/Utils/MagicSearchSingleton.swift b/Linphone/Utils/MagicSearchSingleton.swift index 518bc4245..b65c09bf5 100644 --- a/Linphone/Utils/MagicSearchSingleton.swift +++ b/Linphone/Utils/MagicSearchSingleton.swift @@ -41,7 +41,7 @@ final class MagicSearchSingleton: ObservableObject { @Published var allContact = false private var domainDefaultAccount = "" - var searchSubscription : AnyCancellable? + var searchSubscription: AnyCancellable? private init() { coreContext.doOnCoreQueue { core in diff --git a/Linphone/Utils/PermissionManager.swift b/Linphone/Utils/PermissionManager.swift index e19833012..fb3f72bcc 100644 --- a/Linphone/Utils/PermissionManager.swift +++ b/Linphone/Utils/PermissionManager.swift @@ -31,8 +31,7 @@ class PermissionManager: ObservableObject { private init() {} - - func getPermissions(){ + func getPermissions() { photoLibraryRequestPermission() cameraRequestPermission() contactsRequestPermission()