Compare commits

..

3 commits

Author SHA1 Message Date
Odd E. Ebbesen
13b21b00a9 feat: #821 - Options to disable local typing and read receipts
Some checks failed
Documentation / Build and Deploy Documentation (push) Has been skipped
Checks / Prefligit / prefligit (push) Failing after 5s
Release Docker Image / define-variables (push) Failing after 3s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Checks / Rust / Format (push) Failing after 1s
Checks / Rust / Clippy (push) Failing after 12s
Checks / Rust / Cargo Test (push) Failing after 11s
2025-07-08 14:52:28 +02:00
Odd E. Ebbesen
c3c33f47e2 feat: #821 - Options to disable local typing and read receipts 2025-07-08 14:45:57 +02:00
Odd E. Ebbesen
564e7097e6 feat: #821 - Options to disable local typing and read receipts 2025-07-08 12:43:48 +02:00
4 changed files with 32 additions and 2 deletions

View file

@ -1084,6 +1084,13 @@
# #
#presence_timeout_remote_users = true #presence_timeout_remote_users = true
# Allow local read receipts.
#
# Disabling this will effectively also disable outgoing federated read
# receipts.
#
#allow_local_read_receipts = true
# Allow receiving incoming read receipts from remote servers. # Allow receiving incoming read receipts from remote servers.
# #
#allow_incoming_read_receipts = true #allow_incoming_read_receipts = true
@ -1092,6 +1099,13 @@
# #
#allow_outgoing_read_receipts = true #allow_outgoing_read_receipts = true
# Allow local typing updates.
#
# Disabling this will effectively also disable outgoing federated typing
# updates.
#
#allow_local_typing = true
# Allow outgoing typing updates to federation. # Allow outgoing typing updates to federation.
# #
#allow_outgoing_typing = true #allow_outgoing_typing = true

View file

@ -58,7 +58,9 @@ pub(crate) async fn set_read_marker_route(
} }
if let Some(event) = &body.read_receipt { if let Some(event) = &body.read_receipt {
if !services.users.is_suspended(sender_user).await? { if services.config.allow_local_read_receipts
&& !services.users.is_suspended(sender_user).await?
{
let receipt_content = BTreeMap::from_iter([( let receipt_content = BTreeMap::from_iter([(
event.to_owned(), event.to_owned(),
BTreeMap::from_iter([( BTreeMap::from_iter([(

View file

@ -26,7 +26,7 @@ pub(crate) async fn create_typing_event_route(
{ {
return Err!(Request(Forbidden("You are not in this room."))); return Err!(Request(Forbidden("You are not in this room.")));
} }
if !services.users.is_suspended(sender_user).await? { if services.config.allow_local_typing && !services.users.is_suspended(sender_user).await? {
match body.state { match body.state {
| Typing::Yes(duration) => { | Typing::Yes(duration) => {
let duration = utils::clamp( let duration = utils::clamp(

View file

@ -1259,6 +1259,13 @@ pub struct Config {
#[serde(default = "true_fn")] #[serde(default = "true_fn")]
pub presence_timeout_remote_users: bool, pub presence_timeout_remote_users: bool,
/// Allow local read receipts.
///
/// Disabling this will effectively also disable outgoing federated read
/// receipts.
#[serde(default = "true_fn")]
pub allow_local_read_receipts: bool,
/// Allow receiving incoming read receipts from remote servers. /// Allow receiving incoming read receipts from remote servers.
#[serde(default = "true_fn")] #[serde(default = "true_fn")]
pub allow_incoming_read_receipts: bool, pub allow_incoming_read_receipts: bool,
@ -1267,6 +1274,13 @@ pub struct Config {
#[serde(default = "true_fn")] #[serde(default = "true_fn")]
pub allow_outgoing_read_receipts: bool, pub allow_outgoing_read_receipts: bool,
/// Allow local typing updates.
///
/// Disabling this will effectively also disable outgoing federated typing
/// updates.
#[serde(default = "true_fn")]
pub allow_local_typing: bool,
/// Allow outgoing typing updates to federation. /// Allow outgoing typing updates to federation.
#[serde(default = "true_fn")] #[serde(default = "true_fn")]
pub allow_outgoing_typing: bool, pub allow_outgoing_typing: bool,