mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
use is_muted config, migrate old preference value
This commit is contained in:
@@ -131,15 +131,16 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
|
||||
rpc.start();
|
||||
|
||||
// migrating chat backgrounds, added 04/10/23, can be removed after some versions
|
||||
String backgroundImagePath = Prefs.getStringPreference(this, "pref_chat_background", "");
|
||||
if (!backgroundImagePath.isEmpty()) {
|
||||
// migrating global notifications pref. to per-account config, added 10/July/24
|
||||
final String NOTIFICATION_PREF = "pref_key_enable_notifications";
|
||||
boolean isMuted = !Prefs.getBooleanPreference(this, NOTIFICATION_PREF, true);
|
||||
if (isMuted) {
|
||||
for (int accId : dcAccounts.getAll()) {
|
||||
Prefs.setBackgroundImagePath(this, accId, backgroundImagePath);
|
||||
dcAccounts.getAccount(accId).setMuted(true);
|
||||
}
|
||||
Prefs.setStringPreference(this, "pref_chat_background", "");
|
||||
Prefs.removePreference(this, NOTIFICATION_PREF);
|
||||
}
|
||||
// /migrating chat backgrounds
|
||||
// /migrating global notifications
|
||||
|
||||
for (int accountId : allAccounts) {
|
||||
dcAccounts.getAccount(accountId).setConfig(CONFIG_VERIFIED_ONE_ON_ONE_CHATS, "1");
|
||||
|
||||
Reference in New Issue
Block a user