From d1642d451fff82adf3ede91d956dded01c6fb3a9 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 23 Jul 2024 16:54:10 +0200 Subject: [PATCH] migrate profile-muting from UserDefaults to DcContext --- deltachat-ios/AppDelegate.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deltachat-ios/AppDelegate.swift b/deltachat-ios/AppDelegate.swift index 2d04ea721..87363427e 100644 --- a/deltachat-ios/AppDelegate.swift +++ b/deltachat-ios/AppDelegate.swift @@ -75,6 +75,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD dcAccounts.openDatabase(writeable: true) migrateToDcAccounts() + // migrating global notifications pref. to per-account config, added 2024-07, can be removed after some time + if UserDefaults.standard.bool(forKey: "notifications_disabled") { + for accountId in dcAccounts.getAll() { + dcAccounts.get(id: accountId).setMuted(true) + } + UserDefaults.standard.removeObject(forKey: "notifications_disabled") + } + // /migrating global notifications + self.launchOptions = launchOptions continueDidFinishLaunchingWithOptions() return true