summary refs log tree commit diff
path: root/changelog.d/9275.feature (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-03-18Add tests for PresenceRouter and new module_api methodAndrew Morgan3-12/+336
2021-03-18Update method calls to thread presence_router through to presence handlerAndrew Morgan2-4/+11
2021-03-18Update PresenceHandler to call PresenceRouter methods when applicableAndrew Morgan1-37/+191
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.
2021-03-18Add a storage method to get the current presence state for all usersAndrew Morgan1-1/+60
This will be useful for when PresenceRouter.get_interested_user returns "ALL". It allows for querying all current local user presencee. Note that the `presence_stream` table is culled frequently, and doesn't just grow forever like other stream tables.
2021-03-18Add an exclude_keyvalues option to simple_select_list_paginate_txnAndrew Morgan1-2/+9
Essentially does the same as the existing keyvalues option, but excludes rows with the given column and value.
2021-03-18Add a func to ModuleApi to send all local online user presence to a set of usersAndrew Morgan1-0/+35
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.
2021-03-18Modify `get_interested_parties` and `get_interested_remotes` to query ↵Andrew Morgan1-8