Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 3e0e37c

Browse files
committed
Update docstrings etc
1 parent 5957372 commit 3e0e37c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

synapse/handlers/federation.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,16 +1953,31 @@ async def on_send_membership_event(
19531953
self, origin: str, event: EventBase
19541954
) -> EventContext:
19551955
"""
1956-
We have received a join/leave/knock event for a room.
1956+
We have received a join/leave/knock event for a room via send_join/leave/knock.
19571957
19581958
Verify that event and send it into the room on the remote homeserver's behalf.
19591959
1960+
This is quite similar to on_receive_pdu, with the following principal
1961+
differences:
1962+
* only membership events are permitted (and only events with
1963+
sender==state_key -- ie, no kicks or bans)
1964+
* *We* send out the event on behalf of the remote server.
1965+
* We enforce the membership restrictions of restricted rooms.
1966+
* Rejected events result in an exception rather than being stored.
1967+
1968+
There are also other differences, however it is not clear if these are by
1969+
design or omission. In particular, we do not attempt to backfill any missing
1970+
prev_events.
1971+
19601972
Args:
19611973
origin: The homeserver of the remote (joining/invited/knocking) user.
19621974
event: The member event that has been signed by the remote homeserver.
19631975
19641976
Returns:
19651977
The context of the event after inserting it into the room graph.
1978+
1979+
Raises:
1980+
SynapseError if the event is not accepted into the room
19661981
"""
19671982
logger.debug(
19681983
"on_send_membership_event: Got event: %s, signatures: %s",
@@ -1981,7 +1996,7 @@ async def on_send_membership_event(
19811996
if event.sender != event.state_key:
19821997
raise SynapseError(400, "state_key and sender must match", Codes.BAD_JSON)
19831998

1984-
event.internal_metadata.outlier = False
1999+
assert not event.internal_metadata.outlier
19852000

19862001
# Send this event on behalf of the other server.
19872002
#

0 commit comments

Comments
 (0)