This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add a Synapse Module for configuring presence update routing #9491
Merged
Commits on Mar 25, 2021
-
Configuration menu - View commit details
-
Copy full SHA for de8c33e - Browse repository at this point
Copy the full SHA de8c33eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 09eb6fd - Browse repository at this point
Copy the full SHA 09eb6fdView commit details -
Add a built-in PresenceRouter class
This class will perform in the same manner as Synapse did before, unless a custom PresenceRouter module is configured. If one is, then it will pass through the calls from Synapse to that module.
Configuration menu - View commit details
-
Copy full SHA for 5751f6d - Browse repository at this point
Copy the full SHA 5751f6dView commit details -
Modify
get_interested_parties
andget_interested_remotes
to query…… PresenceRouter This commit asks the PresenceRouter for any users - in addition to those from users that they share a room with - that should receive the given presence updates. These methods are called when routing new presence updates around as they come in. * `get_interested_parties` is called when figuring out which local and remote users to send presence to. For local users, their sync streams will be woken up. * `get_interested_remotes` is specifically for figuring out which remote user(s) a given presence update needs to go to.
Configuration menu - View commit details
-
Copy full SHA for 3600d63 - Browse repository at this point
Copy the full SHA 3600d63View commit details -
Add a func to ModuleApi to send all local online user presence to a s…
…et of users This function is useful for 'catching up' a user if you've just starting directing presence updates their way. Sending the current presence (excluding offline) for each user before you start sending them diffs ensures the target has the right presence state for each user immediately. This effectively just forces a presence initial_sync for the user.
Configuration menu - View commit details
-
Copy full SHA for f62e385 - Browse repository at this point
Copy the full SHA f62e385View commit details -
Update PresenceHandler to call PresenceRouter methods when applicable
This big ol' change does three high-level things: 1. It modifies `_get_interested_in` to ask the loaded PresenceRouter if there are any users - in addition to those that share a room with the user in question - that it thinks should have their presence status queried. PresenceRouter can either return a Set of users, or "ALL". 2. It modifies `get_new_events` (which is mainly run when a user is syncing and needs to check for presence updates) to support receiving "ALL" from `_get_interested_in`. What happens then depends on whether a `from_key` was provided to `get_new_events`. We also now call `get_users_and_states` to filter the UserPresenceState objects after querying ALL of them from a given `from_key`. 3. It also modifies `get_new_events` to take into account whether the syncing user is included in `ModuleApi.send_full_presence_to_local_users`. If so, then we're going to send them all current user presence state (filtering it through `get_users_for_states` again). We then remove the user ID from the set to ensure the same doesn't happen on the next sync. This is mainly all to support redirecting presence for local users as they sync, though the same method is called for appservice users.
Configuration menu - View commit details
-
Copy full SHA for 2a0c785 - Browse repository at this point
Copy the full SHA 2a0c785View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08f39cf - Browse repository at this point
Copy the full SHA 08f39cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c5eb45 - Browse repository at this point
Copy the full SHA 5c5eb45View commit details -
Configuration menu - View commit details
-
Copy full SHA for ff6d051 - Browse repository at this point
Copy the full SHA ff6d051View commit details -
Configuration menu - View commit details
-
Copy full SHA for b67b071 - Browse repository at this point
Copy the full SHA b67b071View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41f9cd1 - Browse repository at this point
Copy the full SHA 41f9cd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fc716c - Browse repository at this point
Copy the full SHA 5fc716cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a2a60e0 - Browse repository at this point
Copy the full SHA a2a60e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 997a81b - Browse repository at this point
Copy the full SHA 997a81bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41537b9 - Browse repository at this point
Copy the full SHA 41537b9View commit details
Commits on Mar 26, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 4fcd817 - Browse repository at this point
Copy the full SHA 4fcd817View commit details -
Co-authored-by: Erik Johnston <erik@matrix.org>
Configuration menu - View commit details
-
Copy full SHA for 744bb53 - Browse repository at this point
Copy the full SHA 744bb53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6daf640 - Browse repository at this point
Copy the full SHA 6daf640View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e2a047 - Browse repository at this point
Copy the full SHA 5e2a047View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37d30d7 - Browse repository at this point
Copy the full SHA 37d30d7View commit details
Commits on Mar 29, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 1dfc8cc - Browse repository at this point
Copy the full SHA 1dfc8ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 42a7db2 - Browse repository at this point
Copy the full SHA 42a7db2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 23c5b93 - Browse repository at this point
Copy the full SHA 23c5b93View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c1eedb - Browse repository at this point
Copy the full SHA 7c1eedbView commit details
Commits on Mar 31, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 5549f52 - Browse repository at this point
Copy the full SHA 5549f52View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fae9f3 - Browse repository at this point
Copy the full SHA 6fae9f3View commit details -
Refactor _filter_all_presence_updates_for_user; always filter through PR
This commit refactors _filter_all_presence_updates_for_user a little bit to allow taking from_key as an optional parameter. The advantage of this function is that we filter presence updates through PresenceRouter. Turns out we had a code path (no from_key, return presence for ALL users) that ended up not filtering through PresenceRouter. Having both code paths end in _filter_all_presence_updates_for_user not only makes things a little easier to follow, but it ensures filtering always happens. I also took the bit where we remove the user from ModuleApi.send_full_presence_to_local_users out of _filter_all_presence_updates_for_user to clean it up a bit further.
Configuration menu - View commit details
-
Copy full SHA for 2f16ed0 - Browse repository at this point
Copy the full SHA 2f16ed0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36a7bd2 - Browse repository at this point
Copy the full SHA 36a7bd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9186191 - Browse repository at this point
Copy the full SHA 9186191View commit details
Commits on Apr 1, 2021
-
Move PresenceRouter module_api test to test_presence_router
This test was more concerned with the functionality of PresenceRouter, so I moved it to the PresenceRouter test file instead.
Configuration menu - View commit details
-
Copy full SHA for ac4b0ff - Browse repository at this point
Copy the full SHA ac4b0ffView commit details -
The current default_config method didn't quite work for the test we just moved in, (it negated any use of @override_config). So convert it to an @override_config call instead.
Configuration menu - View commit details
-
Copy full SHA for 6e42612 - Browse repository at this point
Copy the full SHA 6e42612View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25de4c1 - Browse repository at this point
Copy the full SHA 25de4c1View commit details
Commits on Apr 6, 2021
-
Configuration menu - View commit details
-
Copy full SHA for a1a52f4 - Browse repository at this point
Copy the full SHA a1a52f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for e538126 - Browse repository at this point
Copy the full SHA e538126View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ddbaa8 - Browse repository at this point
Copy the full SHA 9ddbaa8View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.