From 595258ae053a022f11cc36b43cfcb442c02aadb8 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Tue, 9 Dec 2025 14:44:55 +0100 Subject: [PATCH] fix add multi-transport information to `Context.get_info` (#7583) This adds information of all used transports to `Context.get_info` in the key `used_transport_settings`. The format is the same as in `used_account_settings`. The new property also contains the primary account, so we could remove `used_account_settings` now, though there is also `entered_account_settings` in which it stays in relation. - there is an alternative pr at https://github.com/chatmail/core/pull/7584, which gives each transport it's own key, which improves readability. closes #7581 --- src/context.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/context.rs b/src/context.rs index c2e9ede7e..737d66cd0 100644 --- a/src/context.rs +++ b/src/context.rs @@ -822,6 +822,16 @@ impl Context { |(_transport_id, param)| param.to_string(), ); let secondary_addrs = self.get_secondary_self_addrs().await?.join(", "); + let all_transports: Vec = ConfiguredLoginParam::load_all(self) + .await? + .into_iter() + .map(|(transport_id, param)| format!("{transport_id}: {param}")) + .collect(); + let all_transports = if all_transports.is_empty() { + "Not configured".to_string() + } else { + all_transports.join(",") + }; let chats = get_chat_cnt(self).await?; let unblocked_msgs = message::get_unblocked_msg_cnt(self).await; let request_msgs = message::get_request_msg_cnt(self).await; @@ -902,6 +912,7 @@ impl Context { res.insert("proxy_enabled", proxy_enabled.to_string()); res.insert("entered_account_settings", l.to_string()); res.insert("used_account_settings", l2); + res.insert("used_transport_settings", all_transports); if let Some(server_id) = &*self.server_id.read().await { res.insert("imap_server_id", format!("{server_id:?}"));