mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 16:24:48 -04:00
Handle string read receipt data (#10606)
* Handle string read receipt data Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Test that we handle string read receipt data Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Add changelog for #10606 Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Add docs Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Ignore malformed RRs Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Only surround hidden = ... Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Remove unnecessary argument Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update changelog.d/10606.bugfix Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
This commit is contained in:
parent
d1f43b731c
commit
a3a7514570
3 changed files with 32 additions and 1 deletions
|
@ -188,7 +188,14 @@ class ReceiptEventSource:
|
|||
|
||||
new_users = {}
|
||||
for rr_user_id, user_rr in m_read.items():
|
||||
hidden = user_rr.get("hidden", None)
|
||||
try:
|
||||
hidden = user_rr.get("hidden")
|
||||
except AttributeError:
|
||||
# Due to https://github.com/matrix-org/synapse/issues/10376
|
||||
# there are cases where user_rr is a string, in those cases
|
||||
# we just ignore the read receipt
|
||||
continue
|
||||
|
||||
if hidden is not True or rr_user_id == user_id:
|
||||
new_users[rr_user_id] = user_rr.copy()
|
||||
# If hidden has a value replace hidden with the correct prefixed key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue