forked-synapse/synapse/handlers
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
..
ui_auth Remove the deprecated Handlers object (#8494) 2020-10-09 07:24:34 -04:00
__init__.py Remove the deprecated Handlers object (#8494) 2020-10-09 07:24:34 -04:00
_base.py Add type hints to profile and base handlers. (#8609) 2020-10-21 06:44:31 -04:00
account_data.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
account_validity.py Add type hints for account validity handler (#8620) 2020-10-26 14:17:31 -04:00
acme_issuing_service.py Use slots in attrs classes where possible (#8296) 2020-09-14 12:50:06 -04:00
acme.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
admin.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
appservice.py Merge branch 'release-v1.22.0' into develop 2020-10-26 15:02:55 +00:00
auth.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
cas_handler.py Fix handling of User-Agent headers with bad utf-8. (#8632) 2020-10-23 17:12:59 +01:00
deactivate_account.py Move additional tasks to the background worker, part 4 (#8513) 2020-10-13 08:20:32 -04:00
device.py Add typing information to the device handler. (#8407) 2020-10-07 08:58:21 -04:00
devicemessage.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
directory.py Allow ThirdPartyEventRules modules to manipulate public room state (#8292) 2020-10-05 14:57:46 +01:00
e2e_keys.py e2e: ensure we have both master and self-signing key (#8455) 2020-10-26 18:37:47 +00:00
e2e_room_keys.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
events.py Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
federation.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
groups_local.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
identity.py Fix handling of connection timeouts in outgoing http requests (#8400) 2020-09-29 10:29:21 +01:00
initial_sync.py Add type hints to profile and base handlers. (#8609) 2020-10-21 06:44:31 -04:00
message.py Abstract code for stripping room state into a separate method (#8671) 2020-10-27 18:42:46 +00:00
oidc_handler.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
pagination.py Move additional tasks to the background worker, part 4 (#8513) 2020-10-13 08:20:32 -04:00
password_policy.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
presence.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
profile.py Add type hints for account validity handler (#8620) 2020-10-26 14:17:31 -04:00
read_marker.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
receipts.py Send some ephemeral events to appservices (#8437) 2020-10-15 12:33:28 -04:00
register.py Remove the deprecated Handlers object (#8494) 2020-10-09 07:24:34 -04:00
room_list.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room_member_worker.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room_member.py Simplify _locally_reject_invite 2020-10-13 23:58:48 +01:00
room.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
saml_handler.py Fix handling of User-Agent headers with bad utf-8. (#8632) 2020-10-23 17:12:59 +01:00
search.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
set_password.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
state_deltas.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
stats.py Allow background tasks to be run on a separate worker. (#8369) 2020-10-02 08:23:15 -04:00
sync.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
typing.py Don't unnecessarily start bg process while handling typing. (#8668) 2020-10-27 15:32:19 +00:00
user_directory.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00