mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
feat: Revert "Don't fetch messages from unknown folders (#7190)"
This reverts commit 2260156c40. Some users still want to get messages
from all folders as reported by @gerryfrancis.
This commit is contained in:
@@ -1776,7 +1776,7 @@ def test_group_quote(acfactory, lp):
|
|||||||
"xyz",
|
"xyz",
|
||||||
False,
|
False,
|
||||||
"xyz",
|
"xyz",
|
||||||
), # Test that emails aren't found in a random folder
|
), # Test that emails are recognized in a random folder but not moved
|
||||||
(
|
(
|
||||||
"xyz",
|
"xyz",
|
||||||
True,
|
True,
|
||||||
@@ -1806,7 +1806,7 @@ def test_scan_folders(acfactory, lp, folder, move, expected_destination):
|
|||||||
ac1.stop_io()
|
ac1.stop_io()
|
||||||
assert folder in ac1.direct_imap.list_folders()
|
assert folder in ac1.direct_imap.list_folders()
|
||||||
|
|
||||||
lp.sec("Send a message to from ac2 to ac1 and manually move it to `folder`")
|
lp.sec("Send a message to from ac2 to ac1 and manually move it to the mvbox")
|
||||||
ac1.direct_imap.select_config_folder("inbox")
|
ac1.direct_imap.select_config_folder("inbox")
|
||||||
with ac1.direct_imap.idle() as idle1:
|
with ac1.direct_imap.idle() as idle1:
|
||||||
acfactory.get_accepted_chat(ac2, ac1).send_text("hello")
|
acfactory.get_accepted_chat(ac2, ac1).send_text("hello")
|
||||||
@@ -1816,17 +1816,10 @@ def test_scan_folders(acfactory, lp, folder, move, expected_destination):
|
|||||||
lp.sec("start_io() and see if DeltaChat finds the message (" + variant + ")")
|
lp.sec("start_io() and see if DeltaChat finds the message (" + variant + ")")
|
||||||
ac1.set_config("scan_all_folders_debounce_secs", "0")
|
ac1.set_config("scan_all_folders_debounce_secs", "0")
|
||||||
ac1.start_io()
|
ac1.start_io()
|
||||||
chat = ac1.create_chat(ac2)
|
msg = ac1._evtracker.wait_next_incoming_message()
|
||||||
n_msgs = 1 # "Messages are end-to-end encrypted."
|
assert msg.text == "hello"
|
||||||
if folder == "Spam":
|
|
||||||
msg = ac1._evtracker.wait_next_incoming_message()
|
|
||||||
assert msg.text == "hello"
|
|
||||||
n_msgs += 1
|
|
||||||
else:
|
|
||||||
ac1._evtracker.wait_idle_inbox_ready()
|
|
||||||
assert len(chat.get_messages()) == n_msgs
|
|
||||||
|
|
||||||
# The message has reached its destination.
|
# The message has been downloaded, which means it has reached its destination.
|
||||||
ac1.direct_imap.select_folder(expected_destination)
|
ac1.direct_imap.select_folder(expected_destination)
|
||||||
assert len(ac1.direct_imap.get_all_messages()) == 1
|
assert len(ac1.direct_imap.get_all_messages()) == 1
|
||||||
if folder != expected_destination:
|
if folder != expected_destination:
|
||||||
|
|||||||
@@ -823,10 +823,7 @@ impl Session {
|
|||||||
.context("listing folders for resync")?;
|
.context("listing folders for resync")?;
|
||||||
for folder in all_folders {
|
for folder in all_folders {
|
||||||
let folder_meaning = get_folder_meaning(&folder);
|
let folder_meaning = get_folder_meaning(&folder);
|
||||||
if !matches!(
|
if folder_meaning != FolderMeaning::Virtual {
|
||||||
folder_meaning,
|
|
||||||
FolderMeaning::Virtual | FolderMeaning::Unknown
|
|
||||||
) {
|
|
||||||
self.resync_folder_uids(context, folder.name(), folder_meaning)
|
self.resync_folder_uids(context, folder.name(), folder_meaning)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ impl Imap {
|
|||||||
// Don't scan folders that are watched anyway
|
// Don't scan folders that are watched anyway
|
||||||
if !watched_folders.contains(&folder.name().to_string())
|
if !watched_folders.contains(&folder.name().to_string())
|
||||||
&& folder_meaning != FolderMeaning::Trash
|
&& folder_meaning != FolderMeaning::Trash
|
||||||
&& folder_meaning != FolderMeaning::Unknown
|
|
||||||
{
|
{
|
||||||
self.fetch_move_delete(context, session, folder.name(), folder_meaning)
|
self.fetch_move_delete(context, session, folder.name(), folder_meaning)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user