Fix swiftlint warnings

This commit is contained in:
QuentinArguillere 2024-01-02 17:33:54 +01:00
parent d0ae11c880
commit bcf4eefe35
12 changed files with 20 additions and 26 deletions

View file

@ -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 {

View file

@ -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)

View file

@ -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)

View file

@ -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 {

View file

@ -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 })
}

View file

@ -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 {

View file

@ -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 {

View file

@ -28,7 +28,7 @@ class HistoryListViewModel: ObservableObject {
var callLogsTmp: [CallLog] = []
var callLogsAddressToDelete = ""
var callLogSubscription : AnyCancellable?
var callLogSubscription: AnyCancellable?
init() {
computeCallLogsList()
}

View file

@ -17,8 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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: "")

View file

@ -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

View file

@ -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

View file

@ -31,8 +31,7 @@ class PermissionManager: ObservableObject {
private init() {}
func getPermissions(){
func getPermissions() {
photoLibraryRequestPermission()
cameraRequestPermission()
contactsRequestPermission()