anonymousland-synapse/synapse
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
..
_scripts Remove obsolete __future__ imports (#8337) 2020-09-17 08:37:01 -04:00
api Fix handling of User-Agent headers with bad utf-8. (#8632) 2020-10-23 17:12:59 +01:00
app Fix not sending events over federation when using sharded event persisters (#8536) 2020-10-14 13:27:51 +01:00
appservice Limit AS transactions to 100 events (#8606) 2020-10-21 15:36:53 +01:00
config Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
crypto Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
events Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
federation Fix not sending events over federation when using sharded event persisters (#8536) 2020-10-14 13:27:51 +01:00
groups Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
handlers Abstract code for stripping room state into a separate method (#8671) 2020-10-27 18:42:46 +00:00
http Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
logging Start fewer opentracing spans (#8640) 2020-10-26 09:30:19 +00:00
metrics Start fewer opentracing spans (#8640) 2020-10-26 09:30:19 +00:00
module_api Allow modules to create and send events into rooms (#8479) 2020-10-09 13:46:36 +01:00
push Start fewer opentracing spans (#8640) 2020-10-26 09:30:19 +00:00
replication Don't unnecessarily start bg process in replication sending loop. (#8670) 2020-10-27 17:37:08 +00:00
res/templates Include a simple message in email notifications that include encrypted content (#8545) 2020-10-19 09:12:39 -04:00
rest Add admin API to list users' local media (#8647) 2020-10-27 14:12:31 +00:00
server_notices Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
spam_checker_api Combine SpamCheckerApi with the more generic ModuleApi. (#8464) 2020-10-07 12:03:26 +01:00
state Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
static Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
storage Abstract code for stripping room state into a separate method (#8671) 2020-10-27 18:42:46 +00:00
streams Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
util Optimise CacheDescriptor (#8594) 2020-10-21 22:57:45 +01:00
__init__.py 1.22.0 2020-10-27 12:07:19 +00:00
event_auth.py Ensure that event.redacts is the proper type before handling it (#8457) 2020-10-05 10:24:17 -04:00
notifier.py Start fewer opentracing spans (#8640) 2020-10-26 09:30:19 +00:00
python_dependencies.py Drop support for ancient prometheus_client (#8426) 2020-09-30 16:42:05 +01:00
secrets.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
server.py Solidify the HomeServer constructor. (#8515) 2020-10-15 15:29:13 -04:00
types.py Use vector clocks for room stream tokens. (#8439) 2020-10-07 15:15:33 +01:00
visibility.py Do not assume that account data is of the correct form. (#8454) 2020-10-05 09:28:05 -04:00