From 69215874471750440bc4458c613839e0be30d088 Mon Sep 17 00:00:00 2001 From: Paul Cartier Date: Fri, 20 Mar 2020 16:58:08 +0100 Subject: [PATCH] naming --- Classes/LinphoneManager.m | 12 ++++++------ msgNotification/Utils.swift | 2 +- .../NotificationViewController.swift | 6 +++--- msgNotificationService/NotificationService.swift | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index ab172ef6c..36bb19032 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -75,7 +75,7 @@ NSString *const kLinphoneFileTransferRecvUpdate = @"LinphoneFileTransferRecvUpda NSString *const kLinphoneQRCodeFound = @"LinphoneQRCodeFound"; NSString *const kLinphoneChatCreateViewChange = @"LinphoneChatCreateViewChange"; -NSString *const kLinphoneMsgNotificationGroupId = @"group.org.linphone.phone.msgNotification"; +NSString *const kLinphoneMsgNotificationAppGroupId = @"group.org.linphone.phone.msgNotification"; const int kLinphoneAudioVbrCodecDefaultBitrate = 36; /*you can override this from linphonerc or linphonerc-factory*/ @@ -1459,7 +1459,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat linphone_core_cbs_set_qrcode_found(cbs, linphone_iphone_qr_code_found); linphone_core_cbs_set_user_data(cbs, (__bridge void *)(self)); - theLinphoneCore = linphone_factory_create_shared_core_with_config(factory, _configDb, NULL, [kLinphoneMsgNotificationGroupId UTF8String], true); + theLinphoneCore = linphone_factory_create_shared_core_with_config(factory, _configDb, NULL, [kLinphoneMsgNotificationAppGroupId UTF8String], true); linphone_core_add_callbacks(theLinphoneCore, cbs); [CallManager.instance setCoreWithCore:theLinphoneCore]; @@ -1891,7 +1891,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { if (IPAD && [[NSFileManager defaultManager] fileExistsAtPath:factoryIpad]) { factory = factoryIpad; } - _configDb = linphone_config_new_for_shared_core(kLinphoneMsgNotificationGroupId.UTF8String, @"linphonerc".UTF8String, factory.UTF8String); + _configDb = linphone_config_new_for_shared_core(kLinphoneMsgNotificationAppGroupId.UTF8String, @"linphonerc".UTF8String, factory.UTF8String); lp_config_clean_entry(_configDb, "misc", "max_calls"); } #pragma mark - Audio route Functions @@ -2137,19 +2137,19 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { + (NSString *)preferenceFile:(NSString *)file { LinphoneFactory *factory = linphone_factory_get(); - NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_config_dir(factory, kLinphoneMsgNotificationGroupId.UTF8String)]; + NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_config_dir(factory, kLinphoneMsgNotificationAppGroupId.UTF8String)]; return [fullPath stringByAppendingPathComponent:file]; } + (NSString *)dataFile:(NSString *)file { LinphoneFactory *factory = linphone_factory_get(); - NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_data_dir(factory, kLinphoneMsgNotificationGroupId.UTF8String)]; + NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_data_dir(factory, kLinphoneMsgNotificationAppGroupId.UTF8String)]; return [fullPath stringByAppendingPathComponent:file]; } + (NSString *)cacheDirectory { LinphoneFactory *factory = linphone_factory_get(); - NSString *cachePath = [NSString stringWithUTF8String:linphone_factory_get_download_dir(factory, kLinphoneMsgNotificationGroupId.UTF8String)]; + NSString *cachePath = [NSString stringWithUTF8String:linphone_factory_get_download_dir(factory, kLinphoneMsgNotificationAppGroupId.UTF8String)]; BOOL isDir = NO; NSError *error; // cache directory must be created if not existing diff --git a/msgNotification/Utils.swift b/msgNotification/Utils.swift index 66954a4c8..aedb27fd7 100644 --- a/msgNotification/Utils.swift +++ b/msgNotification/Utils.swift @@ -32,7 +32,7 @@ class LinphoneLoggingServiceManager: LoggingServiceDelegate { let debugEnabled = (debugLevel >= LogLevel.Debug.rawValue && debugLevel < LogLevel.Error.rawValue) if (debugEnabled) { - Factory.Instance.logCollectionPath = Factory.Instance.getDownloadDir(context: UnsafeMutablePointer(mutating: (GROUP_ID as NSString).utf8String)) + Factory.Instance.logCollectionPath = Factory.Instance.getDownloadDir(context: UnsafeMutablePointer(mutating: (APP_GROUP_ID as NSString).utf8String)) Factory.Instance.enableLogCollection(state: LogCollectionState.Enabled) log.domain = domain log.logLevel = LogLevel(rawValue: debugLevel) diff --git a/msgNotificationContent/NotificationViewController.swift b/msgNotificationContent/NotificationViewController.swift index 69f240424..aa7866459 100644 --- a/msgNotificationContent/NotificationViewController.swift +++ b/msgNotificationContent/NotificationViewController.swift @@ -23,7 +23,7 @@ import UserNotificationsUI import linphonesw -var GROUP_ID = "group.org.linphone.phone.msgNotification" +var APP_GROUP_ID = "group.org.linphone.phone.msgNotification" var isReplySent: Bool = false var needToStop: Bool = false var coreStopped: Bool = false @@ -132,10 +132,10 @@ class NotificationViewController: UIViewController, UNNotificationContentExtensi } func startCore() throws { - config = Config.newForSharedCore(groupId: GROUP_ID, configFilename: "linphonerc", factoryPath: "") + config = Config.newForSharedCore(appGroupId: APP_GROUP_ID, configFilename: "linphonerc", factoryPath: "") log = LoggingService.Instance /*enable liblinphone logs.*/ logDelegate = try! LinphoneLoggingServiceManager(config: config, log: log, domain: "msgNotificationContent") - lc = try! Factory.Instance.createSharedCoreWithConfig(config: config, systemContext: nil, appGroup: GROUP_ID, mainCore: false) + lc = try! Factory.Instance.createSharedCoreWithConfig(config: config, systemContext: nil, appGroupId: APP_GROUP_ID, mainCore: false) coreDelegate = LinphoneCoreManager() lc!.addDelegate(delegate: coreDelegate) diff --git a/msgNotificationService/NotificationService.swift b/msgNotificationService/NotificationService.swift index 079b1979a..89ca49d19 100644 --- a/msgNotificationService/NotificationService.swift +++ b/msgNotificationService/NotificationService.swift @@ -20,7 +20,7 @@ import UserNotifications import linphonesw -var GROUP_ID = "group.org.linphone.phone.msgNotification" +var APP_GROUP_ID = "group.org.linphone.phone.msgNotification" var LINPHONE_DUMMY_SUBJECT = "dummy subject" struct MsgData: Codable { @@ -153,13 +153,13 @@ class NotificationService: UNNotificationServiceExtension { func createCore() { NSLog("[msgNotificationService] create core") - let config = Config.newForSharedCore(groupId: GROUP_ID, configFilename: "linphonerc", factoryPath: "") + let config = Config.newForSharedCore(appGroupId: APP_GROUP_ID, configFilename: "linphonerc", factoryPath: "") if (NotificationService.log == nil || NotificationService.log.getDelegate() == nil) { NotificationService.log = LoggingService.Instance /*enable liblinphone logs.*/ NotificationService.logDelegate = try! LinphoneLoggingServiceManager(config: config!, log: NotificationService.log, domain: "msgNotificationService") } - lc = try! Factory.Instance.createSharedCoreWithConfig(config: config!, systemContext: nil, appGroup: GROUP_ID, mainCore: false) + lc = try! Factory.Instance.createSharedCoreWithConfig(config: config!, systemContext: nil, appGroupId: APP_GROUP_ID, mainCore: false) } func stopCore() {