mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-26 10:55:09 +01:00
Allow disabling email address specific notification channels
This commit is contained in:
@@ -1535,8 +1535,16 @@ class Core {
|
||||
|
||||
// Current
|
||||
for (TupleMessageEx message : messages) {
|
||||
String group = Long.toString(message.accountNotify ? message.account : 0);
|
||||
// Check if notification channel enabled
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O &&
|
||||
message.from != null && message.from.length > 0) {
|
||||
InternetAddress from = (InternetAddress) message.from[0];
|
||||
NotificationChannel channel = nm.getNotificationChannel("notification." + from.getAddress().toLowerCase());
|
||||
if (channel != null && channel.getImportance() == NotificationManager.IMPORTANCE_NONE)
|
||||
continue;
|
||||
}
|
||||
|
||||
String group = Long.toString(message.accountNotify ? message.account : 0);
|
||||
if (!groupMessages.containsKey(group)) {
|
||||
groupMessages.put(group, new ArrayList<TupleMessageEx>());
|
||||
if (!groupNotifying.containsKey(group))
|
||||
@@ -1735,7 +1743,7 @@ class Core {
|
||||
message.from != null && message.from.length > 0) {
|
||||
InternetAddress from = (InternetAddress) message.from[0];
|
||||
NotificationChannel channel = nm.getNotificationChannel("notification." + from.getAddress().toLowerCase());
|
||||
if (channel != null && channel.getImportance() != NotificationManager.IMPORTANCE_NONE)
|
||||
if (channel != null)
|
||||
channelName = channel.getId();
|
||||
}
|
||||
if (channelName == null)
|
||||
|
||||
Reference in New Issue
Block a user