Commit 067e876a authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

ringtone: save relative path

Change-Id: I2fec967829039caed00a73b587ed8abaf149f99e
parent 266854a9
...@@ -404,10 +404,13 @@ class AccountsService: AccountAdapterDelegate { ...@@ -404,10 +404,13 @@ class AccountsService: AccountAdapterDelegate {
func setRingtonePath(forAccountId accountId: String) { func setRingtonePath(forAccountId accountId: String) {
let details = self.getAccountDetails(fromAccountId: accountId) let details = self.getAccountDetails(fromAccountId: accountId)
guard let ringtonePath = Bundle if details
.main.url(forResource: "default", .get(withConfigKeyModel: ConfigKeyModel(withKey: ConfigKey.ringtonePath)) == "default.wav" {
withExtension: "wav") else { return } return
details.set(withConfigKeyModel: ConfigKeyModel(withKey: ConfigKey.ringtonePath), withValue: (ringtonePath.path)) }
details
.set(withConfigKeyModel: ConfigKeyModel(withKey: ConfigKey.ringtonePath),
withValue: "default.wav")
setAccountDetails(forAccountId: accountId, withDetails: details) setAccountDetails(forAccountId: accountId, withDetails: details)
} }
...@@ -565,11 +568,7 @@ class AccountsService: AccountAdapterDelegate { ...@@ -565,11 +568,7 @@ class AccountsService: AccountAdapterDelegate {
} }
accountDetails!.updateValue("oversip", forKey: ConfigKey.accountDTMFType.rawValue) accountDetails!.updateValue("oversip", forKey: ConfigKey.accountDTMFType.rawValue)
accountDetails!.updateValue("true", forKey: ConfigKey.videoEnabled.rawValue) accountDetails!.updateValue("true", forKey: ConfigKey.videoEnabled.rawValue)
if let ringtonePath = Bundle accountDetails!.updateValue("default.wav", forKey: ConfigKey.ringtonePath.rawValue)
.main.url(forResource: "default",
withExtension: "wav") {
accountDetails!.updateValue(ringtonePath.path, forKey: ConfigKey.ringtonePath.rawValue)
}
accountDetails!.updateValue(accountType, forKey: ConfigKey.accountType.rawValue) accountDetails!.updateValue(accountType, forKey: ConfigKey.accountType.rawValue)
accountDetails!.updateValue("true", forKey: ConfigKey.accountUpnpEnabled.rawValue) accountDetails!.updateValue("true", forKey: ConfigKey.accountUpnpEnabled.rawValue)
return accountDetails! return accountDetails!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment