Add option to toggle publishing for mailing list replies

For some lists, such as release announcement lists, you may not want
replies to posts published.
This commit is contained in:
2024-02-05 11:49:57 -08:00
parent a7629a650a
commit 903577aba7
2 changed files with 26 additions and 7 deletions

View File

@@ -65,6 +65,8 @@ pub struct GitlabWebhookConfig {
#[derive(Clone, Deserialize)]
pub struct MailListConfig {
pub name: String,
#[serde(default = "default_true")]
pub publish_on_replies: bool,
#[serde(default)]
pub rooms: Vec<OwnedRoomOrAliasId>,
}
@@ -89,6 +91,10 @@ pub struct Config {
pub mail_archive: Option<MailArchiveConfig>,
}
fn default_true() -> bool {
true
}
fn load_blocking(path: &String) -> anyhow::Result<Config> {
let f = File::open(path)?;
let r = BufReader::new(f);