mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 00:15:23 -04:00
refactor(event cache): shorten the name of room_event_cache_generic_update
We're in the inner workings of the event cache, so the prefix is redundant, in the ambient context.
This commit is contained in:
@@ -167,7 +167,7 @@ impl fmt::Debug for EventCache {
|
||||
impl EventCache {
|
||||
/// Create a new [`EventCache`] for the given client.
|
||||
pub(crate) fn new(client: WeakClient, event_cache_store: EventCacheStoreLock) -> Self {
|
||||
let (room_event_cache_generic_update_sender, _) = channel(32);
|
||||
let (generic_update_sender, _) = channel(32);
|
||||
|
||||
Self {
|
||||
inner: Arc::new(EventCacheInner {
|
||||
@@ -177,7 +177,7 @@ impl EventCache {
|
||||
by_room: Default::default(),
|
||||
drop_handles: Default::default(),
|
||||
auto_shrink_sender: Default::default(),
|
||||
room_event_cache_generic_update_sender,
|
||||
generic_update_sender,
|
||||
}),
|
||||
}
|
||||
}
|
||||
@@ -389,7 +389,7 @@ impl EventCache {
|
||||
/// without side-effects, this method is recommended. Also, dropping the
|
||||
/// receiver of this channel will not trigger any side-effect.
|
||||
pub fn subscribe_to_room_generic_updates(&self) -> Receiver<RoomEventCacheGenericUpdate> {
|
||||
self.inner.room_event_cache_generic_update_sender.subscribe()
|
||||
self.inner.generic_update_sender.subscribe()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ struct EventCacheInner {
|
||||
///
|
||||
/// See doc comment of [`RoomEventCacheGenericUpdate`] and
|
||||
/// [`EventCache::subscribe_to_room_generic_updates`].
|
||||
room_event_cache_generic_update_sender: Sender<RoomEventCacheGenericUpdate>,
|
||||
generic_update_sender: Sender<RoomEventCacheGenericUpdate>,
|
||||
}
|
||||
|
||||
type AutoShrinkChannelPayload = OwnedRoomId;
|
||||
@@ -612,7 +612,7 @@ impl EventCacheInner {
|
||||
pagination_status,
|
||||
room_id.to_owned(),
|
||||
auto_shrink_sender,
|
||||
self.room_event_cache_generic_update_sender.clone(),
|
||||
self.generic_update_sender.clone(),
|
||||
);
|
||||
|
||||
by_room_guard.insert(room_id.to_owned(), room_event_cache.clone());
|
||||
@@ -621,7 +621,7 @@ impl EventCacheInner {
|
||||
// emit a generic update.
|
||||
if timeline_is_not_empty {
|
||||
let _ = self
|
||||
.room_event_cache_generic_update_sender
|
||||
.generic_update_sender
|
||||
.send(RoomEventCacheGenericUpdate { room_id: room_id.to_owned() });
|
||||
}
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ pub(super) struct RoomEventCacheInner {
|
||||
/// more details.
|
||||
auto_shrink_sender: mpsc::Sender<AutoShrinkChannelPayload>,
|
||||
|
||||
/// A clone of [`EventCacheInner::room_event_cache_generic_update_sender`].
|
||||
/// A clone of [`EventCacheInner::generic_update_sender`].
|
||||
///
|
||||
/// Whilst `EventCacheInner` handles the generic updates from the sync, or
|
||||
/// the storage, it doesn't handle the update from pagination. Having a
|
||||
|
||||
Reference in New Issue
Block a user