Ignore client-specified timestamp in favor of server generated one
This commit is contained in:
parent
27c345f662
commit
297d024965
|
@ -474,13 +474,14 @@ pub fn insert_message(
|
|||
let mut conn = pool.get().map_err(|_| Error::DatabaseFailedInternally)?;
|
||||
let tx = conn.transaction().map_err(|_| Error::DatabaseFailedInternally)?;
|
||||
// Insert the message
|
||||
let timestamp = chrono::Utc::now().timestamp_millis();
|
||||
let stmt = format!(
|
||||
"INSERT INTO {} (public_key, timestamp, data, signature, is_deleted) VALUES (?1, ?2, ?3, ?4, ?5)",
|
||||
storage::MESSAGES_TABLE
|
||||
);
|
||||
match tx.execute(
|
||||
&stmt,
|
||||
params![&requesting_public_key, message.timestamp, message.data, message.signature, 0],
|
||||
params![&requesting_public_key, timestamp, message.data, message.signature, 0],
|
||||
) {
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
|
|
Loading…
Reference in New Issue