Support uploading and downloading message attachments (#13)

This commit is contained in:
Ulyssa 2023-01-10 19:59:30 -08:00
parent 504b520fe1
commit b6f4b03c12
No known key found for this signature in database
GPG key ID: 1B3965A3D18B9B64
14 changed files with 684 additions and 247 deletions

View file

@ -1,6 +1,5 @@
use std::collections::{BTreeMap, HashMap};
use std::path::PathBuf;
use std::sync::mpsc::sync_channel;
use matrix_sdk::ruma::{
event_id,
@ -16,6 +15,7 @@ use matrix_sdk::ruma::{
use lazy_static::lazy_static;
use modalkit::tui::style::Color;
use tokio::sync::mpsc::unbounded_channel;
use url::Url;
use crate::{
@ -154,9 +154,11 @@ pub fn mock_settings() -> ApplicationSettings {
}
}
pub fn mock_store() -> ProgramStore {
let (tx, _) = sync_channel(5);
let worker = Requester { tx };
pub async fn mock_store() -> ProgramStore {
let (tx, _) = unbounded_channel();
let homeserver = Url::parse("https://localhost").unwrap();
let client = matrix_sdk::Client::new(homeserver).await.unwrap();
let worker = Requester { tx, client };
let mut store = ChatStore::new(worker, mock_settings());
let room_id = TEST_ROOM1_ID.clone();