Skip to content

Commit aead1a4

Browse files
mgoldenbergHywan
authored andcommitted
refactor(indexeddb): add room id to event_cache_store::types::Chunk
Signed-off-by: Michael Goldenberg <[email protected]>
1 parent 7fee1c7 commit aead1a4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ impl_event_cache_store! {
162162
.add_chunk(
163163
room_id,
164164
&types::Chunk {
165+
room_id: room_id.to_owned(),
165166
identifier: new.index(),
166167
previous: previous.map(|i| i.index()),
167168
next: next.map(|i| i.index()),
@@ -185,6 +186,7 @@ impl_event_cache_store! {
185186
.add_chunk(
186187
room_id,
187188
&types::Chunk {
189+
room_id: room_id.to_owned(),
188190
identifier: new.index(),
189191
previous: previous.map(|i| i.index()),
190192
next: next.map(|i| i.index()),

crates/matrix-sdk-indexeddb/src/event_cache_store/types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ use matrix_sdk_base::{
1616
deserialized_responses::TimelineEvent, event_cache::store::extract_event_relation,
1717
linked_chunk::ChunkIdentifier,
1818
};
19-
use ruma::OwnedEventId;
19+
use ruma::{OwnedEventId, OwnedRoomId, RoomId};
2020
use serde::{Deserialize, Serialize};
2121

2222
/// Representation of a [`Chunk`](matrix_sdk_base::linked_chunk::Chunk)
2323
/// which can be stored in IndexedDB.
2424
#[derive(Debug, Serialize, Deserialize)]
2525
pub struct Chunk {
26+
/// The room in which the chunk exists.
27+
pub room_id: OwnedRoomId,
2628
/// The identifier of the chunk - i.e.,
2729
/// [`ChunkIdentifier`](matrix_sdk_base::linked_chunk::ChunkIdentifier).
2830
pub identifier: u64,

0 commit comments

Comments
 (0)