Skip to content

Commit 70cc4e5

Browse files
committed
feat(event cache): Enable the redecryptor in the event cache
1 parent 56d81d7 commit 70cc4e5

File tree

1 file changed

+12
-0
lines changed
  • crates/matrix-sdk/src/event_cache

1 file changed

+12
-0
lines changed

crates/matrix-sdk/src/event_cache/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ use crate::{
7474

7575
mod deduplicator;
7676
mod pagination;
77+
#[cfg(feature = "e2e-encryption")]
7778
mod redecryptor;
7879
mod room;
7980

8081
pub use pagination::{RoomPagination, RoomPaginationStatus};
82+
#[cfg(feature = "e2e-encryption")]
83+
pub use redecryptor::{DecryptionRetryRequest, RedecryptorReport};
8184
pub use room::{RoomEventCache, RoomEventCacheSubscriber, ThreadEventCacheUpdate};
8285

8386
/// An error observed in the [`EventCache`].
@@ -149,6 +152,10 @@ pub struct EventCacheDropHandles {
149152

150153
/// The task used to automatically shrink the linked chunks.
151154
auto_shrink_linked_chunk_task: JoinHandle<()>,
155+
156+
/// The task used to automatically redecrypt UTDs.
157+
#[cfg(feature = "e2e-encryption")]
158+
_redecryptor: redecryptor::Redecryptor,
152159
}
153160

154161
impl fmt::Debug for EventCacheDropHandles {
@@ -258,10 +265,15 @@ impl EventCache {
258265
auto_shrink_receiver,
259266
));
260267

268+
#[cfg(feature = "e2e-encryption")]
269+
let redecryptor = redecryptor::Redecryptor::new(Arc::downgrade(&self.inner));
270+
261271
Arc::new(EventCacheDropHandles {
262272
listen_updates_task,
263273
ignore_user_list_update_task,
264274
auto_shrink_linked_chunk_task,
275+
#[cfg(feature = "e2e-encryption")]
276+
_redecryptor: redecryptor,
265277
})
266278
});
267279

0 commit comments

Comments
 (0)