@@ -299,7 +299,8 @@ impl<P: RoomDataProvider> TimelineInner<P> {
299299 ( None , None ) => {
300300 // No record of the reaction, create a local echo
301301
302- let in_flight = state. in_flight_reaction . get :: < AnnotationKey > ( & annotation. into ( ) ) ;
302+ let in_flight =
303+ state. meta . in_flight_reaction . get :: < AnnotationKey > ( & annotation. into ( ) ) ;
303304 let txn_id = match in_flight {
304305 Some ( ReactionState :: Sending ( txn_id) ) => {
305306 // Use the transaction ID as the in flight request
@@ -343,10 +344,10 @@ impl<P: RoomDataProvider> TimelineInner<P> {
343344 }
344345 } ;
345346
346- state. reaction_state . insert ( annotation. into ( ) , reaction_state. clone ( ) ) ;
347+ state. meta . reaction_state . insert ( annotation. into ( ) , reaction_state. clone ( ) ) ;
347348
348349 // Check the action to perform depending on any in flight request
349- let in_flight = state. in_flight_reaction . get :: < AnnotationKey > ( & annotation. into ( ) ) ;
350+ let in_flight = state. meta . in_flight_reaction . get :: < AnnotationKey > ( & annotation. into ( ) ) ;
350351 let result = match in_flight {
351352 Some ( _) => {
352353 // There is an in-flight request
@@ -371,7 +372,7 @@ impl<P: RoomDataProvider> TimelineInner<P> {
371372 ReactionAction :: None => { }
372373 ReactionAction :: SendRemote ( _) | ReactionAction :: RedactRemote ( _) => {
373374 // Remember the new in flight request
374- state. in_flight_reaction . insert ( annotation. into ( ) , reaction_state) ;
375+ state. meta . in_flight_reaction . insert ( annotation. into ( ) , reaction_state) ;
375376 }
376377 } ;
377378
@@ -397,7 +398,7 @@ impl<P: RoomDataProvider> TimelineInner<P> {
397398 }
398399
399400 if let Some ( read_receipt) = read_receipt {
400- self . state . write ( ) . await . read_receipts . upsert_latest (
401+ self . state . write ( ) . await . meta . read_receipts . upsert_latest (
401402 own_user_id,
402403 receipt_type,
403404 read_receipt,
@@ -602,6 +603,7 @@ impl<P: RoomDataProvider> TimelineInner<P> {
602603 let annotation_key: AnnotationKey = annotation. into ( ) ;
603604
604605 let reaction_state = state
606+ . meta
605607 . reaction_state
606608 . get ( & AnnotationKey :: from ( annotation) )
607609 . expect ( "Reaction state should be set before sending the reaction" ) ;
@@ -610,6 +612,7 @@ impl<P: RoomDataProvider> TimelineInner<P> {
610612 ( ReactionToggleResult :: AddSuccess { event_id, .. } , ReactionState :: Redacting ( _) ) => {
611613 // A reaction was added successfully but we've been requested to undo it
612614 state
615+ . meta
613616 . in_flight_reaction
614617 . insert ( annotation_key, ReactionState :: Redacting ( Some ( event_id. to_owned ( ) ) ) ) ;
615618 ReactionAction :: RedactRemote ( event_id. to_owned ( ) )
@@ -618,14 +621,15 @@ impl<P: RoomDataProvider> TimelineInner<P> {
618621 // A reaction was was redacted successfully but we've been requested to undo it
619622 let txn_id = txn_id. to_owned ( ) ;
620623 state
624+ . meta
621625 . in_flight_reaction
622626 . insert ( annotation_key, ReactionState :: Sending ( txn_id. clone ( ) ) ) ;
623627 ReactionAction :: SendRemote ( txn_id)
624628 }
625629 _ => {
626630 // We're done, so also update the timeline
627- state. in_flight_reaction . swap_remove ( & annotation_key) ;
628- state. reaction_state . swap_remove ( & annotation_key) ;
631+ state. meta . in_flight_reaction . swap_remove ( & annotation_key) ;
632+ state. meta . reaction_state . swap_remove ( & annotation_key) ;
629633 state. update_timeline_reaction ( user_id, annotation, result) ?;
630634
631635 ReactionAction :: None
@@ -756,7 +760,7 @@ impl<P: RoomDataProvider> TimelineInner<P> {
756760 let settings = self . settings . clone ( ) ;
757761 let room_data_provider = self . room_data_provider . clone ( ) ;
758762 let push_rules_context = room_data_provider. push_rules_and_context ( ) . await ;
759- let unable_to_decrypt_hook = state. unable_to_decrypt_hook . clone ( ) ;
763+ let unable_to_decrypt_hook = state. meta . unable_to_decrypt_hook . clone ( ) ;
760764
761765 matrix_sdk:: executor:: spawn ( async move {
762766 let retry_one = |item : Arc < TimelineItem > | {
@@ -1080,7 +1084,7 @@ impl TimelineInner {
10801084 match receipt_type {
10811085 SendReceiptType :: Read => {
10821086 if let Some ( ( old_pub_read, _) ) =
1083- state. user_receipt ( own_user_id, ReceiptType :: Read , room) . await
1087+ state. meta . user_receipt ( own_user_id, ReceiptType :: Read , room) . await
10841088 {
10851089 trace ! ( %old_pub_read, "found a previous public receipt" ) ;
10861090 if let Some ( relative_pos) =
@@ -1127,7 +1131,7 @@ impl TimelineInner {
11271131 /// it's folded into another timeline item.
11281132 pub ( crate ) async fn latest_event_id ( & self ) -> Option < OwnedEventId > {
11291133 let state = self . state . read ( ) . await ;
1130- state. all_events . back ( ) . map ( |event_meta| & event_meta. event_id ) . cloned ( )
1134+ state. meta . all_events . back ( ) . map ( |event_meta| & event_meta. event_id ) . cloned ( )
11311135 }
11321136}
11331137
@@ -1169,7 +1173,7 @@ async fn fetch_replied_to_event(
11691173 } ) ;
11701174 let event_item = item. with_content ( TimelineItemContent :: Message ( reply) , None ) ;
11711175
1172- let new_timeline_item = state. new_timeline_item ( event_item) ;
1176+ let new_timeline_item = state. meta . new_timeline_item ( event_item) ;
11731177 state. items . set ( index, new_timeline_item) ;
11741178
11751179 // Don't hold the state lock while the network request is made
0 commit comments