@@ -275,10 +275,11 @@ pub(super) enum TimelineItemPosition {
275
275
/// recent).
276
276
End { origin : RemoteEventOrigin } ,
277
277
278
- /// A single item is updated.
278
+ /// A single item is updated, after it's been successfully decrypted .
279
279
///
280
- /// This only happens when a UTD must be replaced with the decrypted event.
281
- Update ( usize ) ,
280
+ /// This happens when an item that was a UTD must be replaced with the
281
+ /// decrypted event.
282
+ UpdateDecrypted ( usize ) ,
282
283
}
283
284
284
285
/// The outcome of handling a single event with
@@ -480,7 +481,8 @@ impl<'a, 'o> TimelineEventHandler<'a, 'o> {
480
481
if !self . result . item_added {
481
482
trace ! ( "No new item added" ) ;
482
483
483
- if let Flow :: Remote { position : TimelineItemPosition :: Update ( idx) , .. } = self . ctx . flow
484
+ if let Flow :: Remote { position : TimelineItemPosition :: UpdateDecrypted ( idx) , .. } =
485
+ self . ctx . flow
484
486
{
485
487
// If add was not called, that means the UTD event is one that
486
488
// wouldn't normally be visible. Remove it.
@@ -574,7 +576,7 @@ impl<'a, 'o> TimelineEventHandler<'a, 'o> {
574
576
replacement : PendingEdit ,
575
577
) {
576
578
match position {
577
- TimelineItemPosition :: Start { .. } | TimelineItemPosition :: Update ( _) => {
579
+ TimelineItemPosition :: Start { .. } | TimelineItemPosition :: UpdateDecrypted ( _) => {
578
580
// Only insert the edit if there wasn't any other edit
579
581
// before.
580
582
//
@@ -1010,7 +1012,7 @@ impl<'a, 'o> TimelineEventHandler<'a, 'o> {
1010
1012
| TimelineItemPosition :: End { origin } => origin,
1011
1013
1012
1014
// For updates, reuse the origin of the encrypted event.
1013
- TimelineItemPosition :: Update ( idx) => self . items [ idx]
1015
+ TimelineItemPosition :: UpdateDecrypted ( idx) => self . items [ idx]
1014
1016
. as_event ( )
1015
1017
. and_then ( |ev| Some ( ev. as_remote ( ) ?. origin ) )
1016
1018
. unwrap_or_else ( || {
@@ -1160,7 +1162,7 @@ impl<'a, 'o> TimelineEventHandler<'a, 'o> {
1160
1162
1161
1163
Flow :: Remote {
1162
1164
event_id : decrypted_event_id,
1163
- position : TimelineItemPosition :: Update ( idx) ,
1165
+ position : TimelineItemPosition :: UpdateDecrypted ( idx) ,
1164
1166
..
1165
1167
} => {
1166
1168
trace ! ( "Updating timeline item at position {idx}" ) ;
0 commit comments