Wire iOS media downloads through session bridge
This commit is contained in:
@@ -942,7 +942,8 @@ mod tests {
|
||||
.build();
|
||||
let client = FakeTdClient::new()
|
||||
.with_message(chat_id.as_i64(), message)
|
||||
.with_downloaded_file(77, "/tmp/photo.jpg");
|
||||
.with_downloaded_file(77, "/tmp/photo.jpg")
|
||||
.with_downloaded_file(88, "/tmp/voice.ogg");
|
||||
let mut session = CoreSession::new(client);
|
||||
|
||||
session
|
||||
@@ -960,8 +961,10 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
let downloaded = session.download_photo(77).await.unwrap();
|
||||
let downloaded_voice = session.download_voice(88).await.unwrap();
|
||||
|
||||
assert_eq!(downloaded.path, "/tmp/photo.jpg");
|
||||
assert_eq!(downloaded_voice.path, "/tmp/voice.ogg");
|
||||
assert_eq!(session.client().get_forwarded_messages().len(), 1);
|
||||
assert_eq!(
|
||||
reactions,
|
||||
|
||||
@@ -308,7 +308,7 @@ impl FileClient for FakeTdClient {
|
||||
}
|
||||
|
||||
async fn download_voice_note(&self, file_id: i32) -> Result<String, String> {
|
||||
Ok(format!("/tmp/fake_voice_{}.ogg", file_id))
|
||||
FakeTdClient::download_file(self, file_id).await
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user