@@ -230,18 +230,18 @@ impl RoomEventCache {
230
230
. map ( |( _loc, event) | event)
231
231
}
232
232
233
- /// Try to find an event by id in this room, along with its related events.
233
+ /// Try to find an event by ID in this room, along with its related events.
234
234
///
235
235
/// You can filter which types of related events to retrieve using
236
236
/// `filter`. `None` will retrieve related events of any type.
237
237
///
238
238
/// The related events are sorted like this:
239
- /// - events saved out-of-band with `super::RoomEventCache::save_events`
240
- /// will be located at the beginning of the array.
241
- /// - events present in the linked chunk (be it in memory or in the
242
- /// database) will be sorted according to their ordering in the linked
243
- /// chunk.
244
- pub async fn event_with_relations (
239
+ ///
240
+ /// - events saved out-of-band (with `RoomEventCache::save_events`) will be
241
+ /// located at the beginning of the array.
242
+ /// - events present in the linked chunk (be it in memory or in the storage)
243
+ /// will be sorted according to their ordering in the linked chunk.
244
+ pub async fn find_event_with_relations (
245
245
& self ,
246
246
event_id : & EventId ,
247
247
filter : Option < Vec < RelationType > > ,
@@ -1819,7 +1819,7 @@ mod tests {
1819
1819
1820
1820
let filter = Some ( vec ! [ RelationType :: Replacement ] ) ;
1821
1821
let ( event, related_events) =
1822
- room_event_cache. event_with_relations ( original_id, filter) . await . unwrap ( ) ;
1822
+ room_event_cache. find_event_with_relations ( original_id, filter) . await . unwrap ( ) ;
1823
1823
// Fetched event is the right one.
1824
1824
let cached_event_id = event. event_id ( ) . unwrap ( ) ;
1825
1825
assert_eq ! ( cached_event_id, original_id) ;
@@ -1833,7 +1833,7 @@ mod tests {
1833
1833
// Now we'll filter threads instead, there should be no related events
1834
1834
let filter = Some ( vec ! [ RelationType :: Thread ] ) ;
1835
1835
let ( event, related_events) =
1836
- room_event_cache. event_with_relations ( original_id, filter) . await . unwrap ( ) ;
1836
+ room_event_cache. find_event_with_relations ( original_id, filter) . await . unwrap ( ) ;
1837
1837
// Fetched event is the right one.
1838
1838
let cached_event_id = event. event_id ( ) . unwrap ( ) ;
1839
1839
assert_eq ! ( cached_event_id, original_id) ;
@@ -1878,7 +1878,7 @@ mod tests {
1878
1878
room_event_cache. save_events ( [ associated_related_event] ) . await ;
1879
1879
1880
1880
let ( event, related_events) =
1881
- room_event_cache. event_with_relations ( original_id, None ) . await . unwrap ( ) ;
1881
+ room_event_cache. find_event_with_relations ( original_id, None ) . await . unwrap ( ) ;
1882
1882
// Fetched event is the right one.
1883
1883
let cached_event_id = event. event_id ( ) . unwrap ( ) ;
1884
1884
assert_eq ! ( cached_event_id, original_id) ;
@@ -1926,7 +1926,7 @@ mod tests {
1926
1926
room_event_cache. save_events ( [ related_event] ) . await ;
1927
1927
1928
1928
let ( event, related_events) =
1929
- room_event_cache. event_with_relations ( & original_event_id, None ) . await . unwrap ( ) ;
1929
+ room_event_cache. find_event_with_relations ( & original_event_id, None ) . await . unwrap ( ) ;
1930
1930
// Fetched event is the right one.
1931
1931
let cached_event_id = event. event_id ( ) . unwrap ( ) ;
1932
1932
assert_eq ! ( cached_event_id, original_event_id) ;
0 commit comments