mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-06-27 16:35:59 +00:00
feat: Add config option for receiving read receipts
Adds an option for ignoring incoming read receipts over federation
This commit is contained in:
parent
96c2cb9469
commit
c366e0a5ce
3 changed files with 43 additions and 35 deletions
|
@ -748,6 +748,7 @@ pub async fn send_transaction_message_route(
|
|||
match edu {
|
||||
Edu::Presence(_) => {}
|
||||
Edu::Receipt(receipt) => {
|
||||
if services().globals.allow_receiving_read_receipts() {
|
||||
for (room_id, room_updates) in receipt.receipts {
|
||||
for (user_id, user_updates) in room_updates.read {
|
||||
if let Some((event_id, _)) = user_updates
|
||||
|
@ -789,6 +790,7 @@ pub async fn send_transaction_message_route(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Edu::Typing(typing) => {
|
||||
if services()
|
||||
.rooms
|
||||
|
|
|
@ -49,6 +49,8 @@ pub struct Config {
|
|||
#[serde(default = "true_fn")]
|
||||
pub allow_public_read_receipts: bool,
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_receiving_read_receipts: bool,
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_room_creation: bool,
|
||||
#[serde(default = "true_fn")]
|
||||
pub allow_unstable_room_versions: bool,
|
||||
|
|
|
@ -238,6 +238,10 @@ impl Service {
|
|||
self.config.allow_public_read_receipts
|
||||
}
|
||||
|
||||
pub fn allow_receiving_read_receipts(&self) -> bool {
|
||||
self.config.allow_receiving_read_receipts
|
||||
}
|
||||
|
||||
pub fn allow_room_creation(&self) -> bool {
|
||||
self.config.allow_room_creation
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue