mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-10 05:36:41 +02:00
feat: #821 - Options to disable local typing and read receipts
This commit is contained in:
parent
925e200d9c
commit
564e7097e6
4 changed files with 20 additions and 2 deletions
|
@ -1084,6 +1084,10 @@
|
|||
#
|
||||
#presence_timeout_remote_users = true
|
||||
|
||||
# Allow local read receipts
|
||||
#
|
||||
#allow_local_read_receipts = true
|
||||
|
||||
# Allow receiving incoming read receipts from remote servers.
|
||||
#
|
||||
#allow_incoming_read_receipts = true
|
||||
|
@ -1092,6 +1096,10 @@
|
|||
#
|
||||
#allow_outgoing_read_receipts = true
|
||||
|
||||
# Allow local typing updates.
|
||||
#
|
||||
#allow_local_typing = true
|
||||
|
||||
# Allow outgoing typing updates to federation.
|
||||
#
|
||||
#allow_outgoing_typing = true
|
||||
|
|
|
@ -58,7 +58,9 @@ pub(crate) async fn set_read_marker_route(
|
|||
}
|
||||
|
||||
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([(
|
||||
event.to_owned(),
|
||||
BTreeMap::from_iter([(
|
||||
|
|
|
@ -26,7 +26,7 @@ pub(crate) async fn create_typing_event_route(
|
|||
{
|
||||
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 {
|
||||
| Typing::Yes(duration) => {
|
||||
let duration = utils::clamp(
|
||||
|
|
|
@ -1259,6 +1259,10 @@ pub struct Config {
|
|||
#[serde(default = "true_fn")]
|
||||
pub presence_timeout_remote_users: bool,
|
||||
|
||||
/// Allow local read receipts
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_local_read_receipts: bool,
|
||||
|
||||
/// Allow receiving incoming read receipts from remote servers.
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_incoming_read_receipts: bool,
|
||||
|
@ -1267,6 +1271,10 @@ pub struct Config {
|
|||
#[serde(default = "true_fn")]
|
||||
pub allow_outgoing_read_receipts: bool,
|
||||
|
||||
/// Allow local typing updates.
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_local_typing: bool,
|
||||
|
||||
/// Allow outgoing typing updates to federation.
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_outgoing_typing: bool,
|
||||
|
|
Loading…
Add table
Reference in a new issue