synapse-product/synapse/storage/databases/main
Andrew Morgan a699c044b6
Abstract code for stripping room state into a separate method (#8671)
This is a requirement for [knocking](https://github.com/matrix-org/synapse/pull/6739), and is abstracting some code that was originally used by the invite flow. I'm separating it out into this PR as it's a fairly contained change.

For a bit of context: when you invite a user to a room, you send them [stripped state events](https://matrix.org/docs/spec/server_server/unstable#put-matrix-federation-v2-invite-roomid-eventid) as part of `invite_room_state`. This is so that their client can display useful information such as the room name and avatar. The same requirement applies to knocking, as it would be nice for clients to be able to display a list of rooms you've knocked on - room name and avatar included.

The reason we're sending membership events down as well is in the case that you are invited to a room that does not have an avatar or name set. In that case, the client should use the displayname/avatar of the inviter. That information is located in the inviter's membership event.

This is optional as knocks don't really have any user in the room to link up to. When you knock on a room, your knock is sent by you and inserted into the room. It wouldn't *really* make sense to show the avatar of a random user - plus it'd be a data leak. So I've opted not to send membership events to the client here. The UX on the client for when you knock on a room without a name/avatar is a separate problem.

In essence this is just moving some inline code to a reusable store method.
2020-10-27 18:42:46 +00:00
..
schema Add admin API to list users' local media (#8647) 2020-10-27 14:12:31 +00:00
__init__.py Type hints for RegistrationStore (#8615) 2020-10-22 11:56:58 +01:00
account_data.py Do not assume that account data is of the correct form. (#8454) 2020-10-05 09:28:05 -04:00
appservice.py Fix get|set_type_stream_id_for_appservice store functions (#8648) 2020-10-26 15:00:56 +00:00
cache.py Separate get_current_token into two. (#8113) 2020-08-19 10:39:31 +01:00
censor_events.py Move additional tasks to the background worker, part 3 (#8489) 2020-10-09 07:37:51 -04:00
client_ips.py Replace DeferredCache with LruCache where possible (#8563) 2020-10-19 12:20:29 +01:00
deviceinbox.py Use async with for ID gens (#8383) 2020-09-23 16:11:18 +01:00
devices.py Replace DeferredCache with LruCache where possible (#8563) 2020-10-19 12:20:29 +01:00
directory.py Convert additional databases to async/await part 2 (#8200) 2020-09-01 08:39:04 -04:00
e2e_room_keys.py Convert additional database code to async/await. (#8195) 2020-08-28 07:54:27 -04:00
end_to_end_keys.py Invalidate the cache when an olm fallback key is uploaded (#8501) 2020-10-08 13:24:46 -04:00
event_federation.py Move additional tasks to the background worker, part 3 (#8489) 2020-10-09 07:37:51 -04:00
event_push_actions.py Move additional tasks to the background worker, part 3 (#8489) 2020-10-09 07:37:51 -04:00
events_bg_updates.py Add admin API to list users' local media (#8647) 2020-10-27 14:12:31 +00:00
events_worker.py Abstract code for stripping room state into a separate method (#8671) 2020-10-27 18:42:46 +00:00
events.py Replace DeferredCache with LruCache where possible (#8563) 2020-10-19 12:20:29 +01:00
filtering.py Convert additional databases to async/await part 2 (#8200) 2020-09-01 08:39:04 -04:00
group_server.py Use async with for ID gens (#8383) 2020-09-23 16:11:18 +01:00
keys.py Use autocommit mode for single statement DB functions. (#8542) 2020-10-14 15:50:59 +01:00
media_repository.py Add admin API to list users' local media (#8647) 2020-10-27 14:12:31 +00:00
metrics.py Fix user_daily_visits to not have duplicate rows for UA. (#8654) 2020-10-26 13:16:32 +00:00
monthly_active_users.py Move additional tasks to the background worker, part 3 (#8489) 2020-10-09 07:37:51 -04:00
openid.py Convert additional databases to async/await part 2 (#8200) 2020-09-01 08:39:04 -04:00
presence.py Use async with for ID gens (#8383) 2020-09-23 16:11:18 +01:00
profile.py Add type hints for account validity handler (#8620) 2020-10-26 14:17:31 -04:00
purge_events.py Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
push_rule.py Use async with for ID gens (#8383) 2020-09-23 16:11:18 +01:00
pusher.py Add DeferredCache.get_immediate method (#8568) 2020-10-19 15:00:12 +01:00
receipts.py Add DeferredCache.get_immediate method (#8568) 2020-10-19 15:00:12 +01:00
registration.py Add type hints for account validity handler (#8620) 2020-10-26 14:17:31 -04:00
rejections.py Convert simple_select_one and simple_select_one_onecol to async (#8162) 2020-08-26 07:19:32 -04:00
relations.py Convert additional databases to async/await (#8199) 2020-09-01 09:21:48 -04:00
room.py Split admin API for reported events into a detail and a list view (#8539) 2020-10-26 18:16:37 +00:00
roommember.py Consistently use wrap_as_background_task in more places (#8599) 2020-10-20 11:29:38 -04:00
search.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
signatures.py Convert additional databases to async/await part 2 (#8200) 2020-09-01 08:39:04 -04:00
state_deltas.py Convert state and stream stores and related code to async (#8194) 2020-08-28 09:37:55 -04:00
state.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
stats.py Fix missing null character check on guest_access room state 2020-09-22 19:39:29 +01:00
stream.py Use vector clocks for room stream tokens. (#8439) 2020-10-07 15:15:33 +01:00
tags.py Use async with for ID gens (#8383) 2020-09-23 16:11:18 +01:00
transactions.py Use autocommit mode for single statement DB functions. (#8542) 2020-10-14 15:50:59 +01:00
ui_auth.py Allow background tasks to be run on a separate worker. (#8369) 2020-10-02 08:23:15 -04:00
user_directory.py Use autocommit mode for single statement DB functions. (#8542) 2020-10-14 15:50:59 +01:00
user_erasure_store.py Fixed a bug with reactivating users with the admin API (#8362) 2020-09-22 18:19:01 +01:00