Prevent notify move to self

pull/213/head
M66B 1 year ago
parent 6530b162a3
commit e530ea39e3

@ -5945,8 +5945,9 @@ class Core {
if (notify_trash &&
perform_expunge &&
message.accountProtocol == EntityAccount.TYPE_IMAP &&
db.folder().getFolderByType(message.account, EntityFolder.TRASH) != null) {
message.accountProtocol == EntityAccount.TYPE_IMAP) {
EntityFolder folder = db.folder().getFolderByType(message.account, EntityFolder.TRASH);
if (folder != null && !folder.id.equals(message.folder)) {
Intent trash = new Intent(context, ServiceUI.class)
.setAction("trash:" + message.id)
.putExtra("group", group);
@ -5963,6 +5964,7 @@ class Core {
wactions.add(actionTrash.build());
}
}
if (notify_trash &&
((message.accountProtocol == EntityAccount.TYPE_POP && message.accountLeaveDeleted) ||
@ -5985,8 +5987,9 @@ class Core {
}
if (notify_junk &&
message.accountProtocol == EntityAccount.TYPE_IMAP &&
db.folder().getFolderByType(message.account, EntityFolder.JUNK) != null) {
message.accountProtocol == EntityAccount.TYPE_IMAP) {
EntityFolder folder = db.folder().getFolderByType(message.account, EntityFolder.JUNK);
if (folder != null && !folder.id.equals(message.folder)) {
Intent junk = new Intent(context, ServiceUI.class)
.setAction("junk:" + message.id)
.putExtra("group", group);
@ -6002,10 +6005,12 @@ class Core {
wactions.add(actionJunk.build());
}
}
if (notify_archive &&
message.accountProtocol == EntityAccount.TYPE_IMAP &&
db.folder().getFolderByType(message.account, EntityFolder.ARCHIVE) != null) {
message.accountProtocol == EntityAccount.TYPE_IMAP) {
EntityFolder folder = db.folder().getFolderByType(message.account, EntityFolder.ARCHIVE);
if (folder != null && !folder.id.equals(message.folder)) {
Intent archive = new Intent(context, ServiceUI.class)
.setAction("archive:" + message.id)
.putExtra("group", group);
@ -6022,13 +6027,14 @@ class Core {
wactions.add(actionArchive.build());
}
}
if (notify_move &&
message.accountProtocol == EntityAccount.TYPE_IMAP) {
EntityAccount account = db.account().getAccount(message.account);
if (account != null && account.move_to != null) {
EntityFolder folder = db.folder().getFolder(account.move_to);
if (folder != null) {
if (folder != null && !folder.id.equals(message.folder)) {
Intent move = new Intent(context, ServiceUI.class)
.setAction("move:" + message.id)
.putExtra("group", group);

Loading…
Cancel
Save