From eb3c1b3c25d863bb98590ae8344ab2b41d008af3 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Mon, 2 Sep 2024 20:02:58 -0300 Subject: [PATCH 1/2] fix: Display Config::MdnsEnabled as true by default (#5948) --- src/config.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/config.rs b/src/config.rs index 08c884589a..418e8e2217 100644 --- a/src/config.rs +++ b/src/config.rs @@ -129,6 +129,7 @@ pub enum Config { /// True if Message Delivery Notifications (read receipts) should /// be sent and requested. + #[strum(props(default = "1"))] MdnsEnabled, /// True if "Sent" folder should be watched for changes. @@ -516,18 +517,15 @@ impl Context { /// Returns whether MDNs should be requested. pub(crate) async fn should_request_mdns(&self) -> Result { - match self.get_config_bool_opt(Config::MdnsEnabled).await? { - Some(val) => Ok(val), - None => Ok(!self.get_config_bool(Config::Bot).await?), + match self.config_exists(Config::MdnsEnabled).await? { + true => self.get_config_bool(Config::MdnsEnabled).await, + false => Ok(!self.get_config_bool(Config::Bot).await?), } } /// Returns whether MDNs should be sent. pub(crate) async fn should_send_mdns(&self) -> Result { - Ok(self - .get_config_bool_opt(Config::MdnsEnabled) - .await? - .unwrap_or(true)) + self.get_config_bool(Config::MdnsEnabled).await } /// Gets configured "delete_server_after" value. @@ -984,9 +982,13 @@ mod tests { let t = &TestContext::new_alice().await; assert!(t.should_request_mdns().await?); assert!(t.should_send_mdns().await?); + // The setting should be displayed correctly. + assert!(t.get_config_bool(Config::MdnsEnabled).await?); + t.set_config_bool(Config::Bot, true).await?; assert!(!t.should_request_mdns().await?); assert!(t.should_send_mdns().await?); + assert!(t.get_config_bool(Config::MdnsEnabled).await?); Ok(()) } From e4ebb917126a1243c7180358a50e7d0af7742594 Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 2 Sep 2024 23:52:45 +0000 Subject: [PATCH 2/2] chore(release): prepare for 1.142.12 --- CHANGELOG.md | 7 +++++++ Cargo.lock | 10 +++++----- Cargo.toml | 2 +- deltachat-ffi/Cargo.toml | 2 +- deltachat-jsonrpc/Cargo.toml | 2 +- deltachat-jsonrpc/typescript/package.json | 2 +- deltachat-repl/Cargo.toml | 2 +- deltachat-rpc-client/pyproject.toml | 2 +- deltachat-rpc-server/Cargo.toml | 2 +- deltachat-rpc-server/npm-package/package.json | 2 +- package.json | 2 +- python/pyproject.toml | 2 +- release-date.in | 2 +- 13 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02271ee991..77a1318516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.142.12] - 2024-09-02 + +### Fixes + +- Display Config::MdnsEnabled as true by default ([#5948](https://github.com/deltachat/deltachat-core-rust/pull/5948)). + ## [1.142.11] - 2024-08-30 ### Fixes @@ -4799,3 +4805,4 @@ https://github.com/deltachat/deltachat-core-rust/pulls?q=is%3Apr+is%3Aclosed [1.142.9]: https://github.com/deltachat/deltachat-core-rust/compare/v1.142.8...v1.142.9 [1.142.10]: https://github.com/deltachat/deltachat-core-rust/compare/v1.142.9..v1.142.10 [1.142.11]: https://github.com/deltachat/deltachat-core-rust/compare/v1.142.10..v1.142.11 +[1.142.12]: https://github.com/deltachat/deltachat-core-rust/compare/v1.142.11..v1.142.12 diff --git a/Cargo.lock b/Cargo.lock index f1165e58ff..7f24f43faa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "deltachat" -version = "1.142.11" +version = "1.142.12" dependencies = [ "ansi_term", "anyhow", @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "deltachat-jsonrpc" -version = "1.142.11" +version = "1.142.12" dependencies = [ "anyhow", "async-channel 2.3.1", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "deltachat-repl" -version = "1.142.11" +version = "1.142.12" dependencies = [ "ansi_term", "anyhow", @@ -1484,7 +1484,7 @@ dependencies = [ [[package]] name = "deltachat-rpc-server" -version = "1.142.11" +version = "1.142.12" dependencies = [ "anyhow", "deltachat", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "deltachat_ffi" -version = "1.142.11" +version = "1.142.12" dependencies = [ "anyhow", "deltachat", diff --git a/Cargo.toml b/Cargo.toml index 0b7eb267b3..d61db947ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat" -version = "1.142.11" +version = "1.142.12" edition = "2021" license = "MPL-2.0" rust-version = "1.77" diff --git a/deltachat-ffi/Cargo.toml b/deltachat-ffi/Cargo.toml index 3da1362239..3747b80b4c 100644 --- a/deltachat-ffi/Cargo.toml +++ b/deltachat-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat_ffi" -version = "1.142.11" +version = "1.142.12" description = "Deltachat FFI" edition = "2018" readme = "README.md" diff --git a/deltachat-jsonrpc/Cargo.toml b/deltachat-jsonrpc/Cargo.toml index fb29e265e8..c248c28f9e 100644 --- a/deltachat-jsonrpc/Cargo.toml +++ b/deltachat-jsonrpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat-jsonrpc" -version = "1.142.11" +version = "1.142.12" description = "DeltaChat JSON-RPC API" edition = "2021" default-run = "deltachat-jsonrpc-server" diff --git a/deltachat-jsonrpc/typescript/package.json b/deltachat-jsonrpc/typescript/package.json index 546aaea19f..eb074b91f5 100644 --- a/deltachat-jsonrpc/typescript/package.json +++ b/deltachat-jsonrpc/typescript/package.json @@ -58,5 +58,5 @@ }, "type": "module", "types": "dist/deltachat.d.ts", - "version": "1.142.11" + "version": "1.142.12" } diff --git a/deltachat-repl/Cargo.toml b/deltachat-repl/Cargo.toml index 4de00b8725..c4fb8d65b8 100644 --- a/deltachat-repl/Cargo.toml +++ b/deltachat-repl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat-repl" -version = "1.142.11" +version = "1.142.12" license = "MPL-2.0" edition = "2021" repository = "https://github.com/deltachat/deltachat-core-rust" diff --git a/deltachat-rpc-client/pyproject.toml b/deltachat-rpc-client/pyproject.toml index 87698ae183..7c389e086c 100644 --- a/deltachat-rpc-client/pyproject.toml +++ b/deltachat-rpc-client/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "deltachat-rpc-client" -version = "1.142.11" +version = "1.142.12" description = "Python client for Delta Chat core JSON-RPC interface" classifiers = [ "Development Status :: 5 - Production/Stable", diff --git a/deltachat-rpc-server/Cargo.toml b/deltachat-rpc-server/Cargo.toml index 81a51ab75f..ef9de17dff 100644 --- a/deltachat-rpc-server/Cargo.toml +++ b/deltachat-rpc-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat-rpc-server" -version = "1.142.11" +version = "1.142.12" description = "DeltaChat JSON-RPC server" edition = "2021" readme = "README.md" diff --git a/deltachat-rpc-server/npm-package/package.json b/deltachat-rpc-server/npm-package/package.json index a528d574df..efceac421e 100644 --- a/deltachat-rpc-server/npm-package/package.json +++ b/deltachat-rpc-server/npm-package/package.json @@ -15,5 +15,5 @@ }, "type": "module", "types": "index.d.ts", - "version": "1.142.11" + "version": "1.142.12" } diff --git a/package.json b/package.json index 749d62c5e3..d21e48f03b 100644 --- a/package.json +++ b/package.json @@ -55,5 +55,5 @@ "test:mocha": "mocha node/test/test.mjs --growl --reporter=spec --bail --exit" }, "types": "node/dist/index.d.ts", - "version": "1.142.11" + "version": "1.142.12" } diff --git a/python/pyproject.toml b/python/pyproject.toml index 9e1bdede8b..66eb4510d2 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "deltachat" -version = "1.142.11" +version = "1.142.12" description = "Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat" readme = "README.rst" requires-python = ">=3.7" diff --git a/release-date.in b/release-date.in index d77b3a25b5..825b2baeae 100644 --- a/release-date.in +++ b/release-date.in @@ -1 +1 @@ -2024-08-30 \ No newline at end of file +2024-09-02 \ No newline at end of file