Skip to content

Commit fb65e41

Browse files
committed
refactor(sdk): Rename EventFocusedCacheInner to EventFocusedCacheState.
This patch renames `EventFocusedCacheInner` to `EventFocusedCacheState` because it contains the state of the `EventFocusedCacheState`.
1 parent c52b9f5 commit fb65e41

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • crates/matrix-sdk/src/event_cache/caches/event_focused

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub(crate) enum EventFocusedPaginationMode {
9090
},
9191
}
9292

93-
struct EventFocusedCacheInner {
93+
struct EventFocusedCacheState {
9494
/// The room owning this event-focused cache.
9595
room: WeakRoom,
9696

@@ -104,13 +104,13 @@ struct EventFocusedCacheInner {
104104
chunk: EventLinkedChunk,
105105

106106
/// A sender of timeline updates.
107-
sender: Sender<TimelineVectorDiffs>,
107+
sender: EventFocusedCacheUpdateSender,
108108

109109
/// A sender for globally observable linked chunk updates.
110110
linked_chunk_update_sender: Sender<RoomEventCacheLinkedChunkUpdate>,
111111
}
112112

113-
impl EventFocusedCacheInner {
113+
impl EventFocusedCacheState {
114114
/// Initialize the cache from a focused event.
115115
///
116116
/// This uses `/context` to fetch the event with surrounding context.
@@ -521,7 +521,7 @@ impl EventFocusedCacheInner {
521521
/// This is a shallow data structure, and can be cloned cheaply.
522522
#[derive(Clone)]
523523
pub struct EventFocusedCache {
524-
inner: Arc<RwLock<EventFocusedCacheInner>>,
524+
inner: Arc<RwLock<EventFocusedCacheState>>,
525525
}
526526

527527
impl EventFocusedCache {
@@ -532,7 +532,7 @@ impl EventFocusedCache {
532532
linked_chunk_update_sender: Sender<RoomEventCacheLinkedChunkUpdate>,
533533
) -> Self {
534534
Self {
535-
inner: Arc::new(RwLock::new(EventFocusedCacheInner {
535+
inner: Arc::new(RwLock::new(EventFocusedCacheState {
536536
room,
537537
focused_event_id,
538538
pagination_mode: EventFocusedPaginationMode::Room { hide_thread_events: false },
@@ -621,3 +621,6 @@ pub(in super::super) struct EventFocusedCacheKey {
621621
/// The thread mode for this cache.
622622
pub thread_mode: EventFocusThreadMode,
623623
}
624+
625+
/// A small type to send updates in all channels.
626+
pub type EventFocusedCacheUpdateSender = Sender<TimelineVectorDiffs>;

0 commit comments

Comments
 (0)