@@ -45,26 +45,21 @@ impl LatestEventValue {
4545 /// Get the timestamp of the [`LatestEventValue`].
4646 ///
4747 /// If it's [`None`], it returns `None`. If it's [`Remote`], it returns the
48- /// `origin_server_ts`. If it's [`LocalIsSending`] or [`LocalCannotBeSent`],
49- /// it returns the [`timestamp`] value.
48+ /// [`TimelineEvent::timestamp`]. If it's [`LocalIsSending`] or
49+ /// [`LocalCannotBeSent`], it returns the
50+ /// [`LocalLatestEventValue::timestamp`] value.
5051 ///
5152 /// [`None`]: LatestEventValue::None
5253 /// [`Remote`]: LatestEventValue::Remote
5354 /// [`LocalIsSending`]: LatestEventValue::LocalIsSending
5455 /// [`LocalCannotBeSent`]: LatestEventValue::LocalCannotBeSent
55- /// [`timestamp`]: LocalLatestEventValue::timestamp
56- pub fn timestamp ( & self ) -> Option < u64 > {
56+ pub fn timestamp ( & self ) -> Option < MilliSecondsSinceUnixEpoch > {
5757 match self {
5858 Self :: None => None ,
59- Self :: Remote ( remote_latest_event_value) => remote_latest_event_value
60- . kind
61- . raw ( )
62- . get_field :: < u64 > ( "origin_server_ts" )
63- . ok ( )
64- . flatten ( ) ,
59+ Self :: Remote ( remote_latest_event_value) => remote_latest_event_value. timestamp ( ) ,
6560 Self :: LocalIsSending ( LocalLatestEventValue { timestamp, .. } )
6661 | Self :: LocalCannotBeSent ( LocalLatestEventValue { timestamp, .. } ) => {
67- Some ( timestamp. get ( ) . into ( ) )
62+ Some ( timestamp. clone ( ) )
6863 }
6964 }
7065 }
@@ -121,7 +116,7 @@ mod tests_latest_event_value {
121116 . unwrap ( ) ,
122117 ) ) ;
123118
124- assert_eq ! ( value. timestamp( ) , Some ( 42 ) ) ;
119+ assert_eq ! ( value. timestamp( ) , Some ( MilliSecondsSinceUnixEpoch ( uint! ( 42 ) ) ) ) ;
125120 }
126121
127122 #[ test]
@@ -137,7 +132,7 @@ mod tests_latest_event_value {
137132 ) ,
138133 } ) ;
139134
140- assert_eq ! ( value. timestamp( ) , Some ( 42 ) ) ;
135+ assert_eq ! ( value. timestamp( ) , Some ( MilliSecondsSinceUnixEpoch ( uint! ( 42 ) ) ) ) ;
141136 }
142137
143138 #[ test]
@@ -153,7 +148,7 @@ mod tests_latest_event_value {
153148 ) ,
154149 } ) ;
155150
156- assert_eq ! ( value. timestamp( ) , Some ( 42 ) ) ;
151+ assert_eq ! ( value. timestamp( ) , Some ( MilliSecondsSinceUnixEpoch ( uint! ( 42 ) ) ) ) ;
157152 }
158153}
159154
0 commit comments