diff --git a/conduwuit-example.toml b/conduwuit-example.toml index c46fbadf..ef8fc23d 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -592,6 +592,10 @@ allow_profile_lookup_federation_requests = true # Defaults to true. #allow_incoming_read_receipts = true +# Config option to control whether we should send read receipts to remote servers. +# Defaults to true. +#allow_outgoing_read_receipts = true + # Config option to control outgoing typing updates to federation. Defaults to true. #allow_outgoing_typing = true diff --git a/src/config/mod.rs b/src/config/mod.rs index 0a9e4d94..b60f745a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -239,6 +239,8 @@ pub struct Config { #[serde(default = "true_fn")] pub allow_incoming_read_receipts: bool, + #[serde(default = "true_fn")] + pub allow_outgoing_read_receipts: bool, #[serde(default = "true_fn")] pub allow_outgoing_typing: bool, @@ -542,6 +544,10 @@ impl fmt::Display for Config { "Allow incoming remote read receipts", &self.allow_incoming_read_receipts.to_string(), ), + ( + "Allow outgoing remote read receipts", + &self.allow_outgoing_read_receipts.to_string(), + ), ( "Block non-admin room invites (local and remote, admins can still send and receive invites)", &self.block_non_admin_invites.to_string(), diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index f1b3ea64..78714d24 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -299,6 +299,8 @@ impl Service<'_> { pub fn allow_incoming_read_receipts(&self) -> bool { self.config.allow_incoming_read_receipts } + pub fn allow_outgoing_read_receipts(&self) -> bool { self.config.allow_outgoing_read_receipts } + pub fn rocksdb_log_level(&self) -> &String { &self.config.rocksdb_log_level } pub fn rocksdb_max_log_file_size(&self) -> usize { self.config.rocksdb_max_log_file_size } diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index 31051d69..1ee38dfb 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -450,7 +450,10 @@ impl Service { .filter_map(Result::ok) .filter(|user_id| user_id.server_name() == services().globals.server_name()), ); - if !select_edus_receipts(&room_id, since, &mut max_edu_count, &mut events)? { + + if services().globals.allow_outgoing_read_receipts() + && !select_edus_receipts(&room_id, since, &mut max_edu_count, &mut events)? + { break; } }