aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index bdaf13a..ada456c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -93,8 +93,10 @@ 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 +205,11 @@ 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(())