Construct event channel outside of Context

This allows account manager to construct a single event channel and
inject it into all created contexts instead of aggregating events from
separate event emitters.
This commit is contained in:
link2xt
2022-06-11 15:52:55 +00:00
parent 8033966a70
commit 0ed3480258
12 changed files with 95 additions and 136 deletions

View File

@@ -8,6 +8,7 @@ use deltachat::{
context::Context,
dc_receive_imf::dc_receive_imf,
imex::{imex, ImexMode},
Events,
};
use tempfile::tempdir;
@@ -42,7 +43,9 @@ async fn create_context() -> Context {
let dir = tempdir().unwrap();
let dbfile = dir.path().join("db.sqlite");
let id = 100;
let context = Context::new(dbfile.into(), id).await.unwrap();
let context = Context::new(dbfile.into(), id, Events::new())
.await
.unwrap();
let backup: PathBuf = std::env::current_dir()
.unwrap()