mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 14:06:29 +03:00
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:
@@ -260,7 +260,11 @@ impl Peerstate {
|
||||
}
|
||||
|
||||
/// Adds a warning to the chat corresponding to peerstate if fingerprint has changed.
|
||||
pub(crate) async fn handle_fingerprint_change(&self, context: &Context) -> Result<()> {
|
||||
pub(crate) async fn handle_fingerprint_change(
|
||||
&self,
|
||||
context: &Context,
|
||||
timestamp: i64,
|
||||
) -> Result<()> {
|
||||
if self.fingerprint_changed {
|
||||
if let Some(contact_id) = context
|
||||
.sql
|
||||
@@ -273,7 +277,7 @@ impl Peerstate {
|
||||
|
||||
let msg = stock_str::contact_setup_changed(context, self.addr.clone()).await;
|
||||
|
||||
chat::add_info_msg(context, chat_id, msg).await;
|
||||
chat::add_info_msg(context, chat_id, msg, timestamp).await;
|
||||
emit_event!(context, EventType::ChatModified(chat_id));
|
||||
} else {
|
||||
bail!("contact with peerstate.addr {:?} not found", &self.addr);
|
||||
|
||||
Reference in New Issue
Block a user