@@ -32,7 +32,7 @@ use ruma::{
32
32
push:: Action , room_id, uint, RoomId ,
33
33
} ;
34
34
35
- use super :: DynEventCacheStore ;
35
+ use super :: { media :: IgnoreMediaRetentionPolicy , DynEventCacheStore } ;
36
36
use crate :: {
37
37
event_cache:: { Event , Gap } ,
38
38
media:: { MediaFormat , MediaRequestParameters , MediaThumbnailSettings } ,
@@ -168,7 +168,9 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
168
168
) ;
169
169
170
170
// Let's add the media.
171
- self . add_media_content ( & request_file, content. clone ( ) ) . await . expect ( "adding media failed" ) ;
171
+ self . add_media_content ( & request_file, content. clone ( ) , IgnoreMediaRetentionPolicy :: No )
172
+ . await
173
+ . expect ( "adding media failed" ) ;
172
174
173
175
// Media is present in the cache.
174
176
assert_eq ! (
@@ -196,7 +198,7 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
196
198
) ;
197
199
198
200
// Let's add the media again.
199
- self . add_media_content ( & request_file, content. clone ( ) )
201
+ self . add_media_content ( & request_file, content. clone ( ) , IgnoreMediaRetentionPolicy :: No )
200
202
. await
201
203
. expect ( "adding media again failed" ) ;
202
204
@@ -207,9 +209,13 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
207
209
) ;
208
210
209
211
// Let's add the thumbnail media.
210
- self . add_media_content ( & request_thumbnail, thumbnail_content. clone ( ) )
211
- . await
212
- . expect ( "adding thumbnail failed" ) ;
212
+ self . add_media_content (
213
+ & request_thumbnail,
214
+ thumbnail_content. clone ( ) ,
215
+ IgnoreMediaRetentionPolicy :: No ,
216
+ )
217
+ . await
218
+ . expect ( "adding thumbnail failed" ) ;
213
219
214
220
// Media's thumbnail is present.
215
221
assert_eq ! (
@@ -225,9 +231,13 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
225
231
) ;
226
232
227
233
// Let's add another media with a different URI.
228
- self . add_media_content ( & request_other_file, other_content. clone ( ) )
229
- . await
230
- . expect ( "adding other media failed" ) ;
234
+ self . add_media_content (
235
+ & request_other_file,
236
+ other_content. clone ( ) ,
237
+ IgnoreMediaRetentionPolicy :: No ,
238
+ )
239
+ . await
240
+ . expect ( "adding other media failed" ) ;
231
241
232
242
// Other file is present.
233
243
assert_eq ! (
@@ -279,7 +289,9 @@ impl EventCacheStoreIntegrationTests for DynEventCacheStore {
279
289
assert ! ( self . get_media_content( & req) . await . unwrap( ) . is_none( ) , "unexpected media found" ) ;
280
290
281
291
// Add the media.
282
- self . add_media_content ( & req, content. clone ( ) ) . await . expect ( "adding media failed" ) ;
292
+ self . add_media_content ( & req, content. clone ( ) , IgnoreMediaRetentionPolicy :: No )
293
+ . await
294
+ . expect ( "adding media failed" ) ;
283
295
284
296
// Sanity-check: media is found after adding it.
285
297
assert_eq ! ( self . get_media_content( & req) . await . unwrap( ) . unwrap( ) , b"hello" ) ;
0 commit comments