Bug 1653690 - do not report failure if a filter tries to move a message to the same folder. r=mkmelin

--HG--
extra : rebase_source : dee245932fa5d4a651d357b524b07cbcd8fde82d
This commit is contained in:
aceman 2020-08-17 13:57:21 +03:00
Родитель 3a9123b834
Коммит e7afc38a77
2 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -1953,8 +1953,8 @@ NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter* filter,
} }
} }
} else { } else {
MOZ_LOG(FILTERLOGMODULE, LogLevel::Warning, MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
("(Local) Target folder is the same as source folder")); ("(Local) Target folder is the same as source folder, skipping"));
rv = NS_OK; rv = NS_OK;
} }
*applyMore = false; *applyMore = false;
@ -1997,8 +1997,8 @@ NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter* filter,
} else } else
m_msgCopiedByFilter = true; m_msgCopiedByFilter = true;
} else { } else {
MOZ_LOG(FILTERLOGMODULE, LogLevel::Warning, MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
("(Local) Target folder is the same as source folder")); ("(Local) Target folder is the same as source folder, skipping"));
break; break;
} }
} break; } break;

Просмотреть файл

@ -746,8 +746,12 @@ nsresult nsMsgFilterAfterTheFact::ApplyFilter() {
case nsMsgFilterAction::CopyToFolder: { case nsMsgFilterAction::CopyToFolder: {
nsCString uri; nsCString uri;
curFolder->GetURI(uri); curFolder->GetURI(uri);
BREAK_ACTION_IF_FALSE(!uri.Equals(actionTargetFolderUri),
"Target folder is the same as source folder"); if (uri.Equals(actionTargetFolderUri)) {
MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
("(Post) Target folder is the same as source folder, skipping"));
break;
}
nsCOMPtr<nsIMsgFolder> destIFolder; nsCOMPtr<nsIMsgFolder> destIFolder;
rv = GetOrCreateFolder(actionTargetFolderUri, rv = GetOrCreateFolder(actionTargetFolderUri,