Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
QuentinArguillere
05c4300e10 Set default internationalPrefix to 33 // FRA, and use it for calls and chat 2024-11-29 17:10:30 +01:00
2 changed files with 17 additions and 3 deletions

View file

@ -183,10 +183,20 @@ final class CoreContext: ObservableObject {
#else
let pushEnvironment = ""
#endif
for account in core.accountList where account.params?.pushNotificationConfig?.provider != ("apns" + pushEnvironment) {
for account in core.accountList {
let newParams = account.params?.clone()
Log.info("Account \(String(describing: newParams?.identityAddress?.asStringUriOnly())) - updating apple push provider from \(String(describing: newParams?.pushNotificationConfig?.provider)) to apns\(pushEnvironment)")
newParams?.pushNotificationConfig?.provider = "apns" + pushEnvironment
if account.params?.pushNotificationConfig?.provider != ("apns" + pushEnvironment) {
Log.info("Account \(String(describing: newParams?.identityAddress?.asStringUriOnly())) - updating apple push provider from \(String(describing: newParams?.pushNotificationConfig?.provider)) to apns\(pushEnvironment)")
newParams?.pushNotificationConfig?.provider = "apns" + pushEnvironment
}
if account.params?.internationalPrefix == nil {
Log.info("Account \(account.displayName()): no international prefix set, adding 33 FRA by default: \(account.params?.internationalPrefix ?? "NIL")")
newParams?.internationalPrefix = "33"
newParams?.internationalPrefixIsoCountryCode = "FRA"
newParams?.useInternationalPrefixForCallsAndChats = true
}
account.params = newParams
}

View file

@ -114,6 +114,10 @@ class AccountLoginViewModel: ObservableObject {
#endif
accountParams.pushNotificationConfig?.provider = "apns" + pushEnvironment
accountParams.internationalPrefix = "33"
accountParams.internationalPrefixIsoCountryCode = "FRA"
accountParams.useInternationalPrefixForCallsAndChats = true
// Now that our AccountParams is configured, we can create the Account object
let account = try core.createAccount(params: accountParams)