mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 13:26:28 +03:00
Process timer changes before calc_timestamps()
This way system message about timer change gets lower timestamp than the message itself, and it is clear that new timer is applied to the message that just arrived.
This commit is contained in:
@@ -591,18 +591,6 @@ fn add_parts(
|
||||
*chat_id = ChatId::new(DC_CHAT_ID_TRASH);
|
||||
}
|
||||
}
|
||||
// correct message_timestamp, it should not be used before,
|
||||
// however, we cannot do this earlier as we need from_id to be set
|
||||
calc_timestamps(
|
||||
context,
|
||||
*chat_id,
|
||||
from_id,
|
||||
*sent_timestamp,
|
||||
!seen,
|
||||
&mut sort_timestamp,
|
||||
sent_timestamp,
|
||||
&mut rcvd_timestamp,
|
||||
);
|
||||
|
||||
// Extract autodelete timer from the message.
|
||||
let timer = if let Some(value) = mime_parser.get(HeaderDef::AutodeleteTimer) {
|
||||
@@ -645,6 +633,19 @@ fn add_parts(
|
||||
}
|
||||
}
|
||||
|
||||
// correct message_timestamp, it should not be used before,
|
||||
// however, we cannot do this earlier as we need from_id to be set
|
||||
calc_timestamps(
|
||||
context,
|
||||
*chat_id,
|
||||
from_id,
|
||||
*sent_timestamp,
|
||||
!seen,
|
||||
&mut sort_timestamp,
|
||||
sent_timestamp,
|
||||
&mut rcvd_timestamp,
|
||||
);
|
||||
|
||||
// unarchive chat
|
||||
chat_id.unarchive(context)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user