Use smeared timestamps for chat creation times

This commit is contained in:
link2xt
2021-06-26 18:56:21 +03:00
parent 8ce9a78d6c
commit 0b3eece26d
2 changed files with 9 additions and 3 deletions

View File

@@ -1535,6 +1535,7 @@ impl ChatIdBlocked {
_ => (), _ => (),
} }
let created_timestamp = dc_create_smeared_timestamp(context).await;
let chat_id = context let chat_id = context
.sql .sql
.transaction(move |transaction| { .transaction(move |transaction| {
@@ -1547,7 +1548,7 @@ impl ChatIdBlocked {
chat_name, chat_name,
params.to_string(), params.to_string(),
create_blocked as u8, create_blocked as u8,
time(), created_timestamp,
], ],
)?; )?;
let chat_id = ChatId::new( let chat_id = ChatId::new(
@@ -2214,7 +2215,12 @@ pub async fn create_group_chat(
"INSERT INTO chats "INSERT INTO chats
(type, name, grpid, param, created_timestamp) (type, name, grpid, param, created_timestamp)
VALUES(?, ?, ?, \'U=1\', ?);", VALUES(?, ?, ?, \'U=1\', ?);",
paramsv![Chattype::Group, chat_name, grpid, time(),], paramsv![
Chattype::Group,
chat_name,
grpid,
dc_create_smeared_timestamp(context).await,
],
) )
.await?; .await?;

View File

@@ -1797,7 +1797,7 @@ async fn create_multiuser_record(
grpname.as_ref(), grpname.as_ref(),
grpid.as_ref(), grpid.as_ref(),
create_blocked, create_blocked,
time(), dc_create_smeared_timestamp(context).await,
create_protected, create_protected,
], ],
).await?; ).await?;