synapse-product/synapse/storage
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
..
databases Abstract code for stripping room state into a separate method (#8671) 2020-10-27 18:42:46 +00:00
engines Reduce serialization errors in MultiWriterIdGen (#8456) 2020-10-07 15:15:57 +01:00
schema Only run one background update at a time 2020-03-31 17:43:58 +01:00
util Remove racey assertion in MultiWriterIDGenerator (#8530) 2020-10-14 15:40:06 +01:00
__init__.py Make StreamToken.room_key be a RoomStreamToken instance. (#8281) 2020-09-11 12:22:55 +01:00
_base.py Replace DeferredCache with LruCache where possible (#8563) 2020-10-19 12:20:29 +01:00
background_updates.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
database.py Pre-emptively fix synapse.storage.types.Connection for future mypy release (#8577) 2020-10-17 09:51:38 +01:00
keys.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
persist_events.py Fix message duplication if something goes wrong after persisting the event (#8476) 2020-10-13 12:07:56 +01:00
prepare_database.py Add logging on startup/shutdown (#8448) 2020-10-02 15:20:45 +01:00
purge_events.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
push_rule.py Move storage classes into a main "data store". 2019-10-21 16:05:06 +01:00
relations.py Use slots in attrs classes where possible (#8296) 2020-09-14 12:50:06 -04:00
roommember.py Add EventStreamPosition type (#8388) 2020-09-24 13:24:17 +01:00
state.py Mypy fixes for synapse.handlers.federation (#8422) 2020-09-29 15:57:36 +01:00
types.py Pre-emptively fix synapse.storage.types.Connection for future mypy release (#8577) 2020-10-17 09:51:38 +01:00