Skip to content

Commit af923ca

Browse files
committed
fixup! refactor(indexeddb): add migrations and types for media retention metadata index
Signed-off-by: Michael Goldenberg <[email protected]>
1 parent 5d6cc29 commit af923ca

File tree

1 file changed

+7
-0
lines changed
  • crates/matrix-sdk-indexeddb/src/event_cache_store/serializer

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,9 @@ pub struct IndexedMedia {
956956
/// The last time the media was accessed and whether to ignore the
957957
/// [`MediaRetentionPolicy`]
958958
pub last_access: IndexedMediaLastAccessKey,
959+
/// The last the media was accessed, the size (in bytes) of the media
960+
/// content, and whether to ignore the [`MediaRetentionPolicy`]
961+
pub retention_metadata: IndexedMediaRetentionMetadataKey,
959962
/// The (possibly) encrypted metadata - i.e., [`MediaMetadata`][1]
960963
///
961964
/// [1]: crate::event_cache_store::types::MediaMetadata
@@ -1002,6 +1005,10 @@ impl Indexed for Media {
10021005
(self.metadata.ignore_policy, self.metadata.last_access),
10031006
serializer,
10041007
),
1008+
retention_metadata: IndexedMediaRetentionMetadataKey::encode(
1009+
(self.metadata.ignore_policy, self.metadata.last_access, content.len()),
1010+
serializer,
1011+
),
10051012
metadata: serializer.maybe_encrypt_value(&self.metadata)?,
10061013
content,
10071014
})

0 commit comments

Comments
 (0)