Set timestamps for system messages

Previously system messages were always added to the end of the chat,
even if the message triggering them was sent earlier.  This is
especially important for messages about disappearing timer reset
triggered by classic email messages, as they should be placed right
after the message resetting the timer.
This commit is contained in:
link2xt
2021-08-07 14:36:04 +00:00
parent 5a5b80c960
commit 20bf41b4e6
9 changed files with 67 additions and 25 deletions

View File

@@ -11,6 +11,7 @@ use crate::config::Config;
use crate::constants::Blocked;
use crate::contact::{addr_normalize, may_be_valid_addr, Contact, Origin};
use crate::context::Context;
use crate::dc_tools::time;
use crate::key::Fingerprint;
use crate::log::LogExt;
use crate::lot::{Lot, LotState};
@@ -160,7 +161,13 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Lot {
.await
.log_err(context, "Failed to create (new) chat for contact")
{
chat::add_info_msg(context, chat.id, format!("{} verified.", peerstate.addr)).await;
chat::add_info_msg(
context,
chat.id,
format!("{} verified.", peerstate.addr),
time(),
)
.await;
}
} else if let Some(addr) = addr {
lot.state = LotState::QrFprMismatch;