Source:
<code>private boolean shouldNotifyForMessage(Account account, LocalFolder localFolder, Message message) { if (account.getName() == null) { return false; } if (!account.isNotifyNewMail() || message.isSet(Flag.SEEN)) { return false; } Account.FolderMode aDisplayMode = account.getFolderDisplayMode(); Account.FolderMode aNotifyMode = account.getFolderNotifyNewMailMode(); Folder.FolderClass fDisplayClass = localFolder.getDisplayClass(); Folder.FolderClass fNotifyClass = localFolder.getNotifyClass(); if (modeMismatch(aDisplayMode, fDisplayClass)) { return false; } if (modeMismatch(aNotifyMode, fNotifyClass)) { return false; } if (account.getStoreUri().startsWith("pop3") && message.olderThan(new Date(account.getLatestOldMessageSeenTime()))) { return false; } Folder folder = message.getFolder(); if (folder != null) { String folderName = folder.getName(); if (!account.getInboxFolderName().equals(folderName) && (account.getTrashFolderName().equals(folderName) || account.getDraftsFolderName().equals(folderName) || account.getSpamFolderName().equals(folderName) || account.getSentFolderName().equals(folderName))) { return false; } } if (message.getUid() != null && localFolder.getLastUid() != null) { try { Integer messageUid = Integer.parseInt(message.getUid()); if (messageUid <= localFolder.getLastUid()) { Timber.d("Message uid is %s, max message uid is %s. Skipping notification.", messageUid, localFolder.getLastUid()); return false; } } catch (NumberFormatException e) { } } if (account.isAnIdentity(message.getFrom()) && !account.isNotifySelfNewMail()) { return false; } <START> return !account.isNotifyContactsMailOnly() || contacts.isAnyInContacts(message.getFrom()); <END> }</code><technical_language>I find this easier read</technical_language>

Target:
private boolean shouldNotifyForMessage(Account account, LocalFolder localFolder, Message message) { if (account.getName() == null) { return false; } if (!account.isNotifyNewMail() || message.isSet(Flag.SEEN)) { return false; } Account.FolderMode aDisplayMode = account.getFolderDisplayMode(); Account.FolderMode aNotifyMode = account.getFolderNotifyNewMailMode(); Folder.FolderClass fDisplayClass = localFolder.getDisplayClass(); Folder.FolderClass fNotifyClass = localFolder.getNotifyClass(); if (modeMismatch(aDisplayMode, fDisplayClass)) { return false; } if (modeMismatch(aNotifyMode, fNotifyClass)) { return false; } if (account.getStoreUri().startsWith("pop3") && message.olderThan(new Date(account.getLatestOldMessageSeenTime()))) { return false; } Folder folder = message.getFolder(); if (folder != null) { String folderName = folder.getName(); if (!account.getInboxFolderName().equals(folderName) && (account.getTrashFolderName().equals(folderName) || account.getDraftsFolderName().equals(folderName) || account.getSpamFolderName().equals(folderName) || account.getSentFolderName().equals(folderName))) { return false; } } if (message.getUid() != null && localFolder.getLastUid() != null) { try { Integer messageUid = Integer.parseInt(message.getUid()); if (messageUid <= localFolder.getLastUid()) { Timber.d("Message uid is %s, max message uid is %s. Skipping notification.", messageUid, localFolder.getLastUid()); return false; } } catch (NumberFormatException e) { } } if (account.isAnIdentity(message.getFrom()) && !account.isNotifySelfNewMail()) { return false; } if (account.isNotifyContactsMailOnly() && !contacts.isAnyInContacts(message.getFrom())) { return false; } return true; }