forked from mirrors/linphone-iphone
Compare commits
1 commit
master
...
fix/force_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dc9e03c9a |
1 changed files with 15 additions and 1 deletions
|
|
@ -182,6 +182,10 @@ final class CoreContext: ObservableObject {
|
|||
self.shortcuts = shortcuts
|
||||
}
|
||||
}
|
||||
|
||||
for acc in self.mCore.accountList {
|
||||
self.forceRemotePushToMatchVoipPushSettings(account: acc)
|
||||
}
|
||||
|
||||
self.mCoreDelegate = CoreDelegateStub(onGlobalStateChanged: { (core: Core, state: GlobalState, _: String) in
|
||||
if state == GlobalState.On {
|
||||
|
|
@ -338,7 +342,9 @@ final class CoreContext: ObservableObject {
|
|||
|
||||
}
|
||||
}
|
||||
}, onAccountAdded: { (_: Core, _: Account) in
|
||||
}, onAccountAdded: { (_: Core, acc: Account) in
|
||||
self.forceRemotePushToMatchVoipPushSettings(account: acc)
|
||||
|
||||
var accountModels: [AccountModel] = []
|
||||
for account in self.mCore.accountList {
|
||||
accountModels.append(AccountModel(account: account, core: self.mCore))
|
||||
|
|
@ -422,6 +428,14 @@ final class CoreContext: ObservableObject {
|
|||
mCore.removeDelegate(delegate: delegate)
|
||||
}
|
||||
|
||||
func forceRemotePushToMatchVoipPushSettings(account: Account) {
|
||||
if let params = account.params, params.pushNotificationAllowed && !params.remotePushNotificationAllowed {
|
||||
Log.warn("account \(account.displayName()): VOIP and REMOTE push setting mismatch, force \(params.pushNotificationAllowed ? "enabling" : "disabling") of REMOTE Push")
|
||||
let newParams = params.clone()
|
||||
newParams?.remotePushNotificationAllowed = params.pushNotificationAllowed
|
||||
account.params = newParams
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// swiftlint:enable line_length
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue