diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-01-24 12:19:30 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-01-24 12:19:30 +0100 |
commit | 65942dd6f688e77422246eb6ee862bf6f3224b31 (patch) | |
tree | e0cc635b6415ec31678f2a19bb0ad5a66c02edde /src/main.rs | |
parent | acee7556b0c90d96f9fea9b7370f1bd707c4468f (diff) | |
parent | e9c281cbf72413089788d775797906e65cae5599 (diff) | |
download | ezau-65942dd6f688e77422246eb6ee862bf6f3224b31.tar.gz ezau-65942dd6f688e77422246eb6ee862bf6f3224b31.tar.bz2 ezau-65942dd6f688e77422246eb6ee862bf6f3224b31.zip |
Merge branch 'networkjanitor/ezau-multiple-matrix-channels'
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index bdaf13a..b86f281 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,8 +93,11 @@ fn inner_main(opts: &Opts) -> Result<()> { } if let Some(m) = &config.matrix { - matrix::post_link(m.clone().into(), &m.room_id, &log, &permalink) - .context("Could not post link to Matrix")?; + for room_id in &m.room_id { + matrix::post_link(m.clone().into(), room_id, &log, &permalink).context( + format!("Could not post link to Matrix (room_id: {})", &room_id), + )?; + } } } } @@ -203,9 +206,13 @@ fn handle_file(config: &Config, filename: &Path) -> Result<()> { } if let Some(m) = &config.matrix { - matrix::post_link(m.clone().into(), &m.room_id, &log, &permalink) - .context("Could not post link to Matrix")?; - info!("Posted link to Matrix"); + for room_id in &m.room_id { + matrix::post_link(m.clone().into(), room_id, &log, &permalink).context(format!( + "Could not post link to Matrix (room_id: {})", + &room_id + ))?; + info!("Posted link to Matrix ({})", &room_id); + } } Ok(()) |