Set publishEnabled to false by default in app extension, and enable it on main app

This commit is contained in:
Benoit Martins 2025-06-26 10:27:26 +02:00
parent c0916af3ce
commit cba7621413
2 changed files with 15 additions and 0 deletions

View file

@ -306,6 +306,14 @@ class CoreContext: ObservableObject {
NotificationCenter.default.post(name: NSNotification.Name("CoreStarted"), object: nil)
}
ContactsManager.shared.fetchContacts()
if let defaultAccountParams = self.mCore.defaultAccount?.params, defaultAccountParams.publishEnabled == false {
let params = defaultAccountParams
let clonedParams = params.clone()
clonedParams?.publishEnabled = true
self.mCore.defaultAccount?.params = clonedParams
}
if self.mCore.consolidatedPresence != ConsolidatedPresence.Online {
self.updatePresence(core: self.mCore, presence: ConsolidatedPresence.Online)
}

View file

@ -99,6 +99,13 @@ class NotificationService: UNNotificationServiceExtension {
createCore()
// if !lc!.config!.getBool(section: "app", key: "disable_chat_feature", defaultValue: false) {
Log.info("received push payload : \(bestAttemptContent.userInfo.debugDescription)")
if let defaultAccountParams = lc?.defaultAccount?.params, defaultAccountParams.publishEnabled == true {
let params = defaultAccountParams
let clonedParams = params.clone()
clonedParams?.publishEnabled = false
lc?.defaultAccount?.params = clonedParams
}
/*
let defaults = UserDefaults.init(suiteName: Config.appGroupName)