Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Consider every room as having no retention policy if the feature is d…
Browse files Browse the repository at this point in the history
…isabled
  • Loading branch information
babolivier committed Sep 24, 2019
1 parent 32bc69d commit 2581584
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions synapse/storage/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ def get_retention_policy_for_room(self, room_id):
Returns:
dict[int, int]: "min_lifetime" and "max_lifetime" for this room.
"""
# If the room retention feature is disabled, return a policy with no minimum nor
# maximum, in order not to filter out events we should filter out when sending to
# the client.
if not self.config.retention_enabled:
defer.returnValue({
"min_lifetime": None,
"max_lifetime": None,
})

def get_retention_policy_for_room_txn(txn):
txn.execute(
Expand Down

0 comments on commit 2581584

Please sign in to comment.