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

Commit

Permalink
Correctly handle hidden=True
Browse files Browse the repository at this point in the history
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
  • Loading branch information
SimonBrandner committed Jul 19, 2021
1 parent 1dcccd3 commit 59763c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/handlers/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ def filter_out_hidden(events: List[JsonDict], user_id: str) -> List[JsonDict]:
hidden = user_rr.get("hidden", False)
if not hidden or rr_user_id == user_id:
new_users[rr_user_id] = user_rr.copy()
if hidden:
# If hidden has a value replace hidden with the correct prefixed key
if user_rr.get("hidden", None) is not None:
new_users[rr_user_id].pop("hidden")
new_users[rr_user_id]["org.matrix.msc2285.hidden"] = True
new_users[rr_user_id]["org.matrix.msc2285.hidden"] = hidden

# Set new users unless empty
if len(new_users.keys()) > 0:
Expand Down

0 comments on commit 59763c4

Please sign in to comment.