Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
RUST_VERSION: 1.97.0

# Minimum Supported Rust Version
MSRV: 1.89.0
MSRV: 1.95.0

jobs:
lint_rust:
Expand Down
116 changes: 74 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "deltachat"
version = "2.54.0-dev"
edition = "2024"
license = "MPL-2.0"
rust-version = "1.89"
rust-version = "1.95"
repository = "https://github.com/chatmail/core"

[profile.dev]
Expand Down Expand Up @@ -194,7 +194,7 @@ nu-ansi-term = "0.50"
num-traits = "0.2"
rand = "0.9"
regex = "1.12"
rusqlite = "0.37"
rusqlite = "0.40"
sanitize-filename = "0.6"
serde = "1.0"
serde_json = "1"
Expand Down
3 changes: 3 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ skip = [
{ name = "derive_more-impl", version = "1.0.0" },
{ name = "derive_more", version = "1.0.0" },
{ name = "event-listener", version = "2.5.3" },
{ name = "foldhash", version = "0.1.5" },
{ name = "getrandom", version = "0.2.12" },
{ name = "hashbrown", version = "0.15.4" },
{ name = "hashbrown", version = "0.16.1" },
{ name = "heck", version = "0.4.1" },
{ name = "http", version = "0.2.12" },
{ name = "hybrid-array", version = "0.2.3" },
Expand Down
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Here is what to do:
If you have any questions, please send an email to delta@merlinux.eu or ask at https://support.delta.chat/."#;

/// How many recent messages should be re-sent to a new broadcast member.
pub(crate) const N_MSGS_TO_NEW_BROADCAST_MEMBER: usize = 10;
pub(crate) const N_MSGS_TO_NEW_BROADCAST_MEMBER: u32 = 10;

#[cfg(test)]
mod tests {
Expand Down
2 changes: 1 addition & 1 deletion src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use tls::wrap_tls;
pub(crate) const TIMEOUT: Duration = Duration::from_secs(60);

/// TTL for caches in seconds.
pub(crate) const CACHE_TTL: u64 = 30 * 24 * 60 * 60;
pub(crate) const CACHE_TTL: u32 = 30 * 24 * 60 * 60;

/// Removes connection history entries after `CACHE_TTL`.
pub(crate) async fn prune_connection_history(context: &Context) -> Result<()> {
Expand Down
8 changes: 7 additions & 1 deletion src/receive_imf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,12 @@ async fn lookup_or_create_adhoc_group(
for &id in &contact_ids {
stmt.execute((id,)).context("INSERT INTO temp.contacts")?;
}

// Contact IDs are 32-bit internally,
// so this conversion of contact ID set size
// to u32 should never fail.
let contact_ids_len = u32::try_from(contact_ids.len())?;

let val = t
.query_row(
"SELECT c.id, c.blocked
Expand All @@ -2750,7 +2756,7 @@ async fn lookup_or_create_adhoc_group(
AND contact_id NOT IN (SELECT id FROM temp.contacts)
AND add_timestamp >= remove_timestamp)=0
ORDER BY m.timestamp DESC",
(&grpname, contact_ids.len()),
(&grpname, contact_ids_len),
|row| {
let id: ChatId = row.get(0)?;
let blocked: Blocked = row.get(1)?;
Expand Down
6 changes: 3 additions & 3 deletions src/sql/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ pub(crate) async fn msgs_to_key_contacts(context: &Context) -> Result<()> {
return Ok(());
}
let trans_fn = |t: &mut rusqlite::Transaction| {
let mut first_key_contacts_msg_id: u64 = t
let mut first_key_contacts_msg_id: u32 = t
.query_one(
"SELECT CAST(value AS INTEGER) FROM config WHERE keyname='first_key_contacts_msg_id'",
(),
Expand All @@ -682,10 +682,10 @@ pub(crate) async fn msgs_to_key_contacts(context: &Context) -> Result<()> {
)
.context("Prepare stmt")?;
let msgs_to_migrate = 1000;
let mut msgs_migrated: u64 = 0;
let mut msgs_migrated: u32 = 0;
while first_key_contacts_msg_id > 0 && msgs_migrated < msgs_to_migrate {
let start_msg_id = first_key_contacts_msg_id.saturating_sub(msgs_to_migrate);
let cnt: u64 = stmt
let cnt: u32 = stmt
.execute((start_msg_id, first_key_contacts_msg_id))
.context("UPDATE msgs")?
.try_into()?;
Expand Down
6 changes: 3 additions & 3 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct ContactStat {
#[serde(skip_serializing_if = "is_false")]
direct_chat: bool,

last_seen: u64,
last_seen: i64,

#[serde(skip_serializing_if = "Option::is_none")]
transitive_chain: Option<u32>,
Expand Down Expand Up @@ -328,7 +328,7 @@ async fn ensure_last_old_contact_id(context: &Context) -> Result<()> {
return Ok(());
}

let last_contact_id: u64 = context
let last_contact_id: u32 = context
.sql
.query_get_value("SELECT MAX(id) FROM contacts", ())
.await?
Expand Down Expand Up @@ -451,7 +451,7 @@ async fn get_contact_stats(context: &Context, last_old_contact: u32) -> Result<V
let id = row.get(0)?;
let is_encrypted: bool = row.get(1)?;
let verifier: ContactId = row.get(2)?;
let last_seen: u64 = row.get(3)?;
let last_seen: i64 = row.get(3)?;
let bot: bool = row.get(4)?;

let verified = match (is_encrypted, verifier) {
Expand Down
Loading
Loading