small fixes

This commit is contained in:
Hocuri
2026-08-11 14:34:57 +02:00
parent 58061e0689
commit 89cafbd8b0
6 changed files with 16 additions and 19 deletions
+5 -1
View File
@@ -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<String, anyh
filter_out_empty,
)
.await?;
msg += "\nFor these contact, it's unclear how they can reach you:\n";
msg += "\nFor these contacts, it's unclear how they can reach you:\n";
msg += &unknown_contacts.join("\n");
Ok(msg)
@@ -3,8 +3,6 @@ use std::time::Duration;
use anyhow::Context as _;
use super::*;
use crate::chat::{ChatId, get_chat_msgs};
use crate::contact::Contact;
use crate::imap::prefetch_should_download;
use crate::test_utils::{TestContext, TestContextManager};
use crate::tools::SystemTime;
@@ -299,7 +297,8 @@ async fn enable_config(context: &Context) {
/// Tests that `record_message_sent_via_transport()`,
/// `record_message_sent_via_transport_by_msg_id()` and `prefetch_should_download()`
/// correctly populate the `transport_knowledge_by_contacts` table, and that `output_transport_knowledge()`
/// correctly populate the `transport_knowledge_by_contacts` table,
/// and that `output_debug_transport_knowledge()`
/// turns that table into a human-readable device message.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_transport_knowledge() -> 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"
);
+4 -1
View File
@@ -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?;
}
+3 -6
View File
@@ -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,
};
-4
View File
@@ -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 {
-2
View File
@@ -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;