From 89cafbd8b09d52fec49fe3db1cb6510f64d4d98d Mon Sep 17 00:00:00 2001 From: Hocuri Date: Tue, 11 Aug 2026 14:34:57 +0200 Subject: [PATCH] small fixes --- src/automatic_relay_management.rs | 6 +++++- .../automatic_relay_management_tests.rs | 9 ++++----- src/chat.rs | 5 ++++- src/imap.rs | 9 +++------ src/transport.rs | 4 ---- src/transport/transport_tests.rs | 2 -- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/automatic_relay_management.rs b/src/automatic_relay_management.rs index 855f4b0af..ef10597a4 100644 --- a/src/automatic_relay_management.rs +++ b/src/automatic_relay_management.rs @@ -203,6 +203,10 @@ pub(crate) async fn record_message_sent_via_transport( contact_id: ContactId, transport_id: u32, ) -> Result<()> { + if contact_id.is_special() { + return Ok(()); + } + context .sql .execute( @@ -311,7 +315,7 @@ async fn get_debug_transport_knowledge(context: &Context) -> Result Result<()> { @@ -426,7 +425,7 @@ These contacts fail to reach you if you remove transport transport-b@example.org Bob These contacts likely can't reach you anymore: -For these contact, it's unclear how they can reach you: +For these contacts, it's unclear how they can reach you: Dom", "Transport usage output didn't match, actual output was:\n{actual}\n" ); @@ -444,7 +443,7 @@ Bob Charlie These contacts likely can't reach you anymore: Fiona -For these contact, it's unclear how they can reach you: +For these contacts, it's unclear how they can reach you: Dom", "Transport usage output didn't match, actual output was:\n{actual}\n" ); diff --git a/src/chat.rs b/src/chat.rs index e9648101d..00eb1589d 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2751,7 +2751,10 @@ async fn prepare_send_msg( } chat.prepare_msg_raw(context, msg, update_msg_id).await?; - if msg.viewtype == Viewtype::Text && msg.text == "/transport_knowledge_by_contacts" { + if msg.to_id == ContactId::SELF + && msg.from_id == ContactId::SELF + && msg.text == "/transport_knowledge_by_contacts" + { output_debug_transport_knowledge(context).await?; } diff --git a/src/imap.rs b/src/imap.rs index a798e50cb..eb447698a 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -42,13 +42,10 @@ use crate::transport::{ }; use crate::{ automatic_relay_management::record_message_sent_via_transport, - chat::{self, add_device_msg}, -}; -use crate::{ - automatic_relay_management::record_message_sent_via_transport_by_msg_id, config::Config, -}; -use crate::{ + automatic_relay_management::record_message_sent_via_transport_by_msg_id, calls::{UnresolvedIceServer, create_fallback_ice_servers, create_ice_servers_from_metadata}, + chat::{self, add_device_msg}, + config::Config, ephemeral::delete_expired_imap_messages, }; diff --git a/src/transport.rs b/src/transport.rs index b69e5f985..7c77f4da7 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -16,18 +16,14 @@ use deltachat_contact_tools::{EmailAddress, addr_normalize}; use serde::{Deserialize, Serialize}; use crate::config::Config; -use crate::contact::ContactId; use crate::context::Context; use crate::ensure_and_debug_assert; use crate::events::EventType; -use crate::log::warn; use crate::login_param::EnteredLoginParam; -use crate::message::MsgId; use crate::net::load_connection_timestamp; use crate::provider::Socket; use crate::sql::Sql; use crate::sync::{RemovedTransportData, SyncData, TransportData}; -use crate::tools::time; #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub(crate) enum ConnectionSecurity { diff --git a/src/transport/transport_tests.rs b/src/transport/transport_tests.rs index e50839a63..a70ccdd40 100644 --- a/src/transport/transport_tests.rs +++ b/src/transport/transport_tests.rs @@ -1,9 +1,7 @@ use std::collections::BTreeSet; use std::time::Duration; -use crate::imap::prefetch_should_download; use crate::tools::SystemTime; -use crate::transport::add_pseudo_transport; use super::*; use crate::test_utils::TestContext;