mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2025-12-24 00:01:03 -05:00
fixup! feat(room): make load_event_with_relations also load relations when falling back to the network
Cache related events after loading them Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
committed by
Andy Balaam
parent
c82e1b8ec3
commit
db4e1b2c00
@@ -4100,7 +4100,16 @@ impl Room {
|
||||
event_id: OwnedEventId,
|
||||
opts: RelationsOptions,
|
||||
) -> Result<Relations> {
|
||||
opts.send(self, event_id).await
|
||||
let relations = opts.send(self, event_id).await;
|
||||
|
||||
// Save any new related events to the cache.
|
||||
if let Ok(Relations { chunk, .. }) = &relations
|
||||
&& let Ok((cache, _handles)) = self.event_cache().await
|
||||
{
|
||||
cache.save_events(chunk.clone()).await;
|
||||
}
|
||||
|
||||
relations
|
||||
}
|
||||
|
||||
/// Search this room's [`RoomIndex`] for query and return at most
|
||||
|
||||
Reference in New Issue
Block a user