message_age

Function message_age 

Source
pub fn message_age(message: &Message) -> Duration
Expand description

Calculate the age of a message based on its ETA or expires timestamp

§Arguments

  • message - The message to check

§Returns

Duration representing the estimated age of the message. If the message has an ETA in the past, returns the duration since that ETA. If the message has an expires timestamp, estimates age as 1/4 of time until expiration. Otherwise returns zero.

Note: This is an estimation since messages don’t carry creation timestamps. For accurate message age tracking, add a custom header with creation timestamp.