From a34a41f1354147565da248bf3222449c6e976035 Mon Sep 17 00:00:00 2001
From: SpiritCroc <dev@spiritcroc.de>
Date: Tue, 17 May 2022 12:03:07 +0200
Subject: [PATCH] Fix push for m.read events (#12721)

badge_count_last_call was always zero when the response for push
notifications included a "rejected" key which mapped to an empty list.
---
 changelog.d/12721.bugfix   | 1 +
 synapse/push/httppusher.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 changelog.d/12721.bugfix

diff --git a/changelog.d/12721.bugfix b/changelog.d/12721.bugfix
new file mode 100644
index 0000000000..6987f7ab15
--- /dev/null
+++ b/changelog.d/12721.bugfix
@@ -0,0 +1 @@
+Fix push to dismiss notifications when read on another client. Contributed by @SpiritCroc @ Beeper.
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index 5818344520..d5603596c0 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -405,7 +405,7 @@ class HttpPusher(Pusher):
         rejected = []
         if "rejected" in resp:
             rejected = resp["rejected"]
-        else:
+        if not rejected:
             self.badge_count_last_call = badge
         return rejected
 
-- 
GitLab