mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 22:46:29 +03:00
Bunch of feedback: renames, simple functions, no cow
This commit is contained in:
@@ -22,7 +22,7 @@ use crate::context::Context;
|
||||
use crate::events::EventType;
|
||||
use crate::message::Message;
|
||||
use crate::provider::get_provider_update_timestamp;
|
||||
use crate::stock::{BadTimeMsgBody, UpdateReminderMsgBody};
|
||||
use crate::stock_str;
|
||||
|
||||
/// Shortens a string to a specified length and adds "[...]" to the
|
||||
/// end of the shortened string.
|
||||
@@ -169,15 +169,14 @@ async fn maybe_warn_on_bad_time(context: &Context, now: i64, known_past_timestam
|
||||
if now < known_past_timestamp {
|
||||
let mut msg = Message::new(Viewtype::Text);
|
||||
msg.text = Some(
|
||||
BadTimeMsgBody::stock_str(
|
||||
stock_str::bad_time_msg_body(
|
||||
context,
|
||||
Local
|
||||
.timestamp(now, 0)
|
||||
.format("%Y-%m-%d %H:%M:%S")
|
||||
.to_string(),
|
||||
)
|
||||
.await
|
||||
.to_string(),
|
||||
.await,
|
||||
);
|
||||
add_device_msg_with_importance(
|
||||
context,
|
||||
@@ -201,7 +200,7 @@ async fn maybe_warn_on_bad_time(context: &Context, now: i64, known_past_timestam
|
||||
async fn maybe_warn_on_outdated(context: &Context, now: i64, approx_compile_time: i64) {
|
||||
if now > approx_compile_time + DC_OUTDATED_WARNING_DAYS * 24 * 60 * 60 {
|
||||
let mut msg = Message::new(Viewtype::Text);
|
||||
msg.text = Some(UpdateReminderMsgBody::stock_str(context).await.into());
|
||||
msg.text = Some(stock_str::update_reminder_msg_body(context).await);
|
||||
add_device_msg(
|
||||
context,
|
||||
Some(
|
||||
|
||||
Reference in New Issue
Block a user