Skip to main content

tuwunel_core/config/
read_receipts.rs

1//! Configures federated read receipts.
2//!
3//! Incoming and outgoing receipt delivery have separate controls.
4
5/// Federated read-receipt configuration.
6pub use Config as ReadReceipts;
7use serde::Deserialize;
8use tuwunel_macros::config_example_generator;
9
10use super::true_fn;
11
12/// Federated read receipts
13///
14/// Controls whether read receipts are exchanged with other servers. Both
15/// directions are on by default. Receipts between users of this server work
16/// regardless of these keys.
17#[expect(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)]
18#[derive(Clone, Copy, Debug, Deserialize)]
19#[config_example_generator(
20	filename = "tuwunel-example.toml",
21	section = "global.read_receipts",
22	group = "true"
23)]
24pub struct Config {
25	/// Allows receiving read receipts from remote servers.
26	///
27	/// reloadable: yes
28	/// legacy: allow_incoming_read_receipts
29	#[serde(default = "true_fn")]
30	pub allow_incoming: bool,
31
32	/// Allows sending read receipts to remote servers.
33	///
34	/// reloadable: yes
35	/// legacy: allow_outgoing_read_receipts
36	#[serde(default = "true_fn")]
37	pub allow_outgoing: bool,
38}
39
40impl Default for Config {
41	fn default() -> Self {
42		Self {
43			allow_incoming: true_fn(),
44			allow_outgoing: true_fn(),
45		}
46	}
47}