mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 07:16:31 +03:00
chore: update chrono from 0.4.34 to 0.4.37
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -658,9 +658,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.34"
|
version = "0.4.37"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b"
|
checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android-tzdata",
|
"android-tzdata",
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ fn get_next_backup_path(
|
|||||||
backup_time: i64,
|
backup_time: i64,
|
||||||
) -> Result<(PathBuf, PathBuf, PathBuf)> {
|
) -> Result<(PathBuf, PathBuf, PathBuf)> {
|
||||||
let folder = PathBuf::from(folder);
|
let folder = PathBuf::from(folder);
|
||||||
let stem = chrono::NaiveDateTime::from_timestamp_opt(backup_time, 0)
|
let stem = chrono::DateTime::<chrono::Utc>::from_timestamp(backup_time, 0)
|
||||||
.context("can't get next backup path")?
|
.context("can't get next backup path")?
|
||||||
// Don't change this file name format, in `dc_imex_has_backup` we use string comparison to determine which backup is newer:
|
// Don't change this file name format, in `dc_imex_has_backup` we use string comparison to determine which backup is newer:
|
||||||
.format("delta-chat-backup-%Y-%m-%d")
|
.format("delta-chat-backup-%Y-%m-%d")
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ impl Kml {
|
|||||||
// 0 4 7 10 13 16 19
|
// 0 4 7 10 13 16 19
|
||||||
match chrono::NaiveDateTime::parse_from_str(&val, "%Y-%m-%dT%H:%M:%SZ") {
|
match chrono::NaiveDateTime::parse_from_str(&val, "%Y-%m-%dT%H:%M:%SZ") {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
self.curr.timestamp = res.timestamp();
|
self.curr.timestamp = res.and_utc().timestamp();
|
||||||
let now = time();
|
let now = time();
|
||||||
if self.curr.timestamp > now {
|
if self.curr.timestamp > now {
|
||||||
self.curr.timestamp = now;
|
self.curr.timestamp = now;
|
||||||
@@ -540,7 +540,7 @@ pub async fn get_kml(context: &Context, chat_id: ChatId) -> Result<Option<(Strin
|
|||||||
|
|
||||||
fn get_kml_timestamp(utc: i64) -> String {
|
fn get_kml_timestamp(utc: i64) -> String {
|
||||||
// Returns a string formatted as YYYY-MM-DDTHH:MM:SSZ. The trailing `Z` indicates UTC.
|
// Returns a string formatted as YYYY-MM-DDTHH:MM:SSZ. The trailing `Z` indicates UTC.
|
||||||
chrono::NaiveDateTime::from_timestamp_opt(utc, 0)
|
chrono::DateTime::<chrono::Utc>::from_timestamp(utc, 0)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.format("%Y-%m-%dT%H:%M:%SZ")
|
.format("%Y-%m-%dT%H:%M:%SZ")
|
||||||
.to_string()
|
.to_string()
|
||||||
|
|||||||
@@ -575,11 +575,7 @@ impl<'a> MimeFactory<'a> {
|
|||||||
.protected
|
.protected
|
||||||
.push(Header::new("Subject".into(), encoded_subject));
|
.push(Header::new("Subject".into(), encoded_subject));
|
||||||
|
|
||||||
let date = chrono::Utc
|
let date = chrono::DateTime::<chrono::Utc>::from_timestamp(self.timestamp, 0)
|
||||||
.from_local_datetime(
|
|
||||||
&chrono::NaiveDateTime::from_timestamp_opt(self.timestamp, 0)
|
|
||||||
.context("can't convert timestamp to NativeDateTime")?,
|
|
||||||
)
|
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_rfc2822();
|
.to_rfc2822();
|
||||||
headers.unprotected.push(Header::new("Date".into(), date));
|
headers.unprotected.push(Header::new("Date".into(), date));
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ pub fn get_release_timestamp() -> i64 {
|
|||||||
*crate::release::DATE,
|
*crate::release::DATE,
|
||||||
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
|
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
|
||||||
)
|
)
|
||||||
|
.and_utc()
|
||||||
.timestamp_millis()
|
.timestamp_millis()
|
||||||
/ 1_000
|
/ 1_000
|
||||||
}
|
}
|
||||||
@@ -205,7 +206,7 @@ async fn maybe_warn_on_bad_time(context: &Context, now: i64, known_past_timestam
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
if let Some(timestamp) = chrono::NaiveDateTime::from_timestamp_opt(now, 0) {
|
if let Some(timestamp) = chrono::DateTime::<chrono::Utc>::from_timestamp(now, 0) {
|
||||||
add_device_msg_with_importance(
|
add_device_msg_with_importance(
|
||||||
context,
|
context,
|
||||||
Some(
|
Some(
|
||||||
@@ -232,7 +233,7 @@ async fn maybe_warn_on_outdated(context: &Context, now: i64, approx_compile_time
|
|||||||
if now > approx_compile_time + DC_OUTDATED_WARNING_DAYS * 24 * 60 * 60 {
|
if now > approx_compile_time + DC_OUTDATED_WARNING_DAYS * 24 * 60 * 60 {
|
||||||
let mut msg = Message::new(Viewtype::Text);
|
let mut msg = Message::new(Viewtype::Text);
|
||||||
msg.text = stock_str::update_reminder_msg_body(context).await;
|
msg.text = stock_str::update_reminder_msg_body(context).await;
|
||||||
if let Some(timestamp) = chrono::NaiveDateTime::from_timestamp_opt(now, 0) {
|
if let Some(timestamp) = chrono::DateTime::<chrono::Utc>::from_timestamp(now, 0) {
|
||||||
add_device_msg(
|
add_device_msg(
|
||||||
context,
|
context,
|
||||||
Some(
|
Some(
|
||||||
@@ -1214,6 +1215,7 @@ DKIM Results: Passed=true, Works=true, Allow_Keychange=true";
|
|||||||
NaiveDate::from_ymd_opt(2020, 9, 1).unwrap(),
|
NaiveDate::from_ymd_opt(2020, 9, 1).unwrap(),
|
||||||
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
|
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
|
||||||
)
|
)
|
||||||
|
.and_utc()
|
||||||
.timestamp_millis()
|
.timestamp_millis()
|
||||||
/ 1_000;
|
/ 1_000;
|
||||||
|
|
||||||
@@ -1329,6 +1331,7 @@ DKIM Results: Passed=true, Works=true, Allow_Keychange=true";
|
|||||||
NaiveDate::from_ymd_opt(2020, 9, 9).unwrap(),
|
NaiveDate::from_ymd_opt(2020, 9, 9).unwrap(),
|
||||||
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
|
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
|
||||||
)
|
)
|
||||||
|
.and_utc()
|
||||||
.timestamp_millis()
|
.timestamp_millis()
|
||||||
/ 1_000;
|
/ 1_000;
|
||||||
assert!(get_release_timestamp() <= time());
|
assert!(get_release_timestamp() <= time());
|
||||||
|
|||||||
Reference in New Issue
Block a user