Seperate notification channel for separate accounts

This commit is contained in:
M66B
2018-12-10 12:26:50 +01:00
parent f552a9b23d
commit bd58041ab1
4 changed files with 59 additions and 4 deletions

View File

@@ -676,7 +676,7 @@ public class FragmentAccount extends FragmentEx {
!user.equals(account.user) || !password.equals(account.password)));
boolean reload = (check || account == null ||
account.synchronize != synchronize ||
account.poll_interval.equals(Integer.parseInt(interval)));
!account.poll_interval.equals(Integer.parseInt(interval)));
// Check IMAP server
if (check) {
@@ -750,6 +750,15 @@ public class FragmentAccount extends FragmentEx {
else
account.id = db.account().insertAccount(account);
// Make sure the channel exists on commit
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O)
if (account.notify) {
// Add or update notification channel
account.deleteNotificationChannel(context);
account.createNotificationChannel(context);
} else if (!account.synchronize)
account.deleteNotificationChannel(context);
List<EntityFolder> folders = new ArrayList<>();
EntityFolder inbox = new EntityFolder();