Skip to content

Commit 3d8483d

Browse files
committed
feat: Enable OnlyFetchMvbox by default (#7190)
This is a replacement for 2260156 "feat: Don't fetch messages from unknown folders", but limited to the case with `MvboxMove` enabled. It's enabled by default, so most users still gain from not fetching messages from unknown folders.
1 parent f308098 commit 3d8483d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub enum Config {
169169
///
170170
/// This will not entirely disable other folders, e.g. the spam folder will also still
171171
/// be scanned for new messages.
172-
#[strum(props(default = "0"))]
172+
#[strum(props(default = "1"))]
173173
OnlyFetchMvbox,
174174

175175
/// Whether to show classic emails or only chat messages.

src/sql/migrations.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,20 @@ CREATE INDEX gossip_timestamp_index ON gossip_timestamp (chat_id, fingerprint);
12751275
.await?;
12761276
}
12771277

1278+
inc_and_check(&mut migration_version, 135)?;
1279+
if dbversion < migration_version {
1280+
// `OnlyFetchMvbox` is now 1 by default to avoid scanning unknown folders. But if the user
1281+
// disabled `MvboxMove`, we have to keep `OnlyFetchMvbox` unset so that Inbox is watched.
1282+
sql.execute_migration(
1283+
"INSERT OR IGNORE INTO config (keyname, value)
1284+
SELECT 'only_fetch_mvbox', '0'
1285+
FROM config WHERE keyname='mvbox_move' AND value='0'
1286+
",
1287+
migration_version,
1288+
)
1289+
.await?;
1290+
}
1291+
12781292
let new_version = sql
12791293
.get_raw_config_int(VERSION_CFG)
12801294
.await?

0 commit comments

Comments
 (0)