File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ impl SearchIndexGuard<'_> {
87
87
88
88
/// Handle an [`AnyMessageLikeEvent`] in the [`RoomIndex`] of a given
89
89
/// [`RoomId`]
90
+ ///
91
+ /// This which will add/remove/edit an event in the index based on the
92
+ /// event type.
90
93
pub ( crate ) fn handle_event (
91
94
& mut self ,
92
95
event : AnyMessageLikeEvent ,
Original file line number Diff line number Diff line change @@ -1481,14 +1481,17 @@ mod private {
1481
1481
}
1482
1482
}
1483
1483
1484
+ /// Takes a [`TimelineEvent`] and passes it to the [`RoomIndex`] of the
1485
+ /// given room which will add/remove/edit an event in the index based on
1486
+ /// the event type.
1484
1487
#[ cfg( feature = "experimental-search" ) ]
1485
- async fn index_handle_timeline_event (
1488
+ async fn index_event (
1486
1489
& self ,
1487
1490
event : & TimelineEvent ,
1488
1491
room : & Room ,
1489
1492
) -> Result < ( ) , EventCacheError > {
1490
1493
if let Some ( message_event) = self . parse_timeline_event ( event) {
1491
- room. index_handle_event ( message_event) . await . map_err ( EventCacheError :: from)
1494
+ room. index_event ( message_event) . await . map_err ( EventCacheError :: from)
1492
1495
} else {
1493
1496
Ok ( ( ) )
1494
1497
}
@@ -1514,7 +1517,7 @@ mod private {
1514
1517
1515
1518
// We can also add the event to the index.
1516
1519
#[ cfg( feature = "experimental-search" ) ]
1517
- if let Err ( err) = self . index_handle_timeline_event ( & event, room) . await {
1520
+ if let Err ( err) = self . index_event ( & event, room) . await {
1518
1521
warn ! ( "error while trying to index event: {err:?}" ) ;
1519
1522
}
1520
1523
Original file line number Diff line number Diff line change @@ -3678,12 +3678,12 @@ impl Room {
3678
3678
opts. send ( self , event_id) . await
3679
3679
}
3680
3680
3681
- /// Handle an [`AnyMessageLikeEvent`] in this room's [`RoomIndex`]
3681
+ /// Handle an [`AnyMessageLikeEvent`] in this room's [`RoomIndex`].
3682
+ ///
3683
+ /// This which will add/remove/edit an event in the index based on the
3684
+ /// event type.
3682
3685
#[ cfg( feature = "experimental-search" ) ]
3683
- pub ( crate ) async fn index_handle_event (
3684
- & self ,
3685
- event : AnyMessageLikeEvent ,
3686
- ) -> Result < ( ) , IndexError > {
3686
+ pub ( crate ) async fn index_event ( & self , event : AnyMessageLikeEvent ) -> Result < ( ) , IndexError > {
3687
3687
self . client . search_index ( ) . lock ( ) . await . handle_event ( event, self . room_id ( ) )
3688
3688
}
3689
3689
You can’t perform that action at this time.
0 commit comments