Wire iOS media downloads through session bridge

This commit is contained in:
Mikhail Kilin
2026-05-21 00:29:47 +03:00
parent 4fd2a18ed9
commit 892582df67
8 changed files with 50 additions and 2 deletions

View File

@@ -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,

View File

@@ -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
}
}