mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
In the new-style notification, directly go to message if new message
count is 1. This matches what is displayed in the notification itself.
This commit is contained in:
parent
e17e9b9344
commit
aaa65a457e
@ -4701,8 +4701,18 @@ public class MessagingController implements Runnable {
|
||||
}
|
||||
|
||||
Intent targetIntent;
|
||||
boolean treatAsSingleMessageNotification;
|
||||
|
||||
if (unreadCount == 1) {
|
||||
if (platformSupportsExtendedNotifications()) {
|
||||
// in the new-style notifications, we focus on the new messages, not the unread ones
|
||||
treatAsSingleMessageNotification = newMessages == 1;
|
||||
} else {
|
||||
// in the old-style notifications, we focus on unread messages, as we don't have a
|
||||
// good way to express the new message count
|
||||
treatAsSingleMessageNotification = unreadCount == 1;
|
||||
}
|
||||
|
||||
if (treatAsSingleMessageNotification) {
|
||||
targetIntent = MessageView.actionHandleNotificationIntent(
|
||||
context, message.makeMessageReference());
|
||||
} else {
|
||||
@ -4717,6 +4727,7 @@ public class MessagingController implements Runnable {
|
||||
|
||||
targetIntent = FolderList.actionHandleNotification(context, account, initialFolder);
|
||||
}
|
||||
|
||||
PendingIntent pi = PendingIntent.getActivity(context, 0, targetIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
builder.setContentIntent(pi);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user