mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-26 20:43:48 +03: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
ccc5030896
commit
9d4f2884e1
3 changed files with 43 additions and 35 deletions
|
@ -746,6 +746,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
|
||||
|
@ -787,6 +788,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…
Reference in a new issue