mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Use a database table to hold the users that should have full presence sent to them, instead of something in-memory (#9823)
This commit is contained in:
parent
206a7b5f12
commit
4d6e5a5e99
11 changed files with 477 additions and 156 deletions
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue