File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
crates/matrix-sdk/src/room/timeline Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -108,19 +108,11 @@ impl TimelineInner {
108108 pub ( super ) fn add_event_id ( & self , txn_id : & TransactionId , event_id : OwnedEventId ) {
109109 let mut lock = self . items . lock_mut ( ) ;
110110 if let Some ( ( idx, item) ) = find_event_by_txn_id ( & lock, txn_id) {
111- match & item. key {
112- TimelineKey :: TransactionId ( _) => {
113- lock. set_cloned (
114- idx,
115- Arc :: new ( TimelineItem :: Event ( item. with_event_id ( Some ( event_id) ) ) ) ,
116- ) ;
117- }
118- TimelineKey :: EventId ( ev_id) => {
119- if * ev_id != event_id {
120- error ! ( "remote echo and send-event response disagree on the event ID" ) ;
121- }
122- }
111+ if item. event_id . as_ref ( ) . map_or ( false , |ev_id| * ev_id != event_id) {
112+ error ! ( "remote echo and send-event response disagree on the event ID" ) ;
123113 }
114+
115+ lock. set_cloned ( idx, Arc :: new ( TimelineItem :: Event ( item. with_event_id ( Some ( event_id) ) ) ) ) ;
124116 } else {
125117 warn ! ( %txn_id, "Timeline item not found, can't add event ID" ) ;
126118 }
You can’t perform that action at this time.
0 commit comments