summary refs log tree commit diff
path: root/synapse/replication/http
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2021-05-18 14:13:45 +0100
committerGitHub <noreply@github.com>2021-05-18 14:13:45 +0100
commit4d6e5a5e995590efe44855d10dcd2a89b841dae8 (patch)
tree793277f5bfeebe433857743707620660122aa3dd /synapse/replication/http
parentFix the allowed range of valid ordering characters for spaces. (#10002) (diff)
downloadsynapse-4d6e5a5e995590efe44855d10dcd2a89b841dae8.tar.xz
Use a database table to hold the users that should have full presence sent to them, instead of something in-memory (#9823)
Diffstat (limited to 'synapse/replication/http')
-rw-r--r--synapse/replication/http/presence.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/replication/http/presence.py b/synapse/replication/http/presence.py
index f25307620d..bb00247953 100644
--- a/synapse/replication/http/presence.py
+++ b/synapse/replication/http/presence.py
@@ -73,6 +73,7 @@ class ReplicationPresenceSetState(ReplicationEndpoint):
         {
             "state": { ... },
             "ignore_status_msg": false,
+            "force_notify": false
         }
 
         200 OK
@@ -91,17 +92,23 @@ class ReplicationPresenceSetState(ReplicationEndpoint):
         self._presence_handler = hs.get_presence_handler()
 
     @staticmethod
-    async def _serialize_payload(user_id, state, ignore_status_msg=False):
+    async def _serialize_payload(
+        user_id, state, ignore_status_msg=False, force_notify=False
+    ):
         return {
             "state": state,
             "ignore_status_msg": ignore_status_msg,
+            "force_notify": force_notify,
         }
 
     async def _handle_request(self, request, user_id):
         content = parse_json_object_from_request(request)
 
         await self._presence_handler.set_state(
-            UserID.from_string(user_id), content["state"], content["ignore_status_msg"]
+            UserID.from_string(user_id),
+            content["state"],
+            content["ignore_status_msg"],
+            content["force_notify"],
         )
 
         return (