Skip to content

Commit

Permalink
Fix creating batch sent member events on worker
Browse files Browse the repository at this point in the history
Signed-off-by: Tulir Asokan <[email protected]>
  • Loading branch information
tulir committed Nov 2, 2021
1 parent f0c73d8 commit deaf3d8
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1382,13 +1382,14 @@ async def persist_and_notify_client_event(

if event.type == EventTypes.Member:
if event.content["membership"] == Membership.INVITE:
event.unsigned[
"invite_room_state"
] = await self.store.get_stripped_room_state_from_event_context(
context,
self.room_prejoin_state_types,
membership_user_id=event.sender,
)
if not event.internal_metadata.outlier:
event.unsigned[
"invite_room_state"
] = await self.store.get_stripped_room_state_from_event_context(
context,
self.room_prejoin_state_types,
membership_user_id=event.sender,
)

invitee = UserID.from_string(event.state_key)
if not self.hs.is_mine(invitee):
Expand All @@ -1405,12 +1406,13 @@ async def persist_and_notify_client_event(
event.signatures.update(returned_invite.signatures)

if event.content["membership"] == Membership.KNOCK:
event.unsigned[
"knock_room_state"
] = await self.store.get_stripped_room_state_from_event_context(
context,
self.room_prejoin_state_types,
)
if not event.internal_metadata.outlier:
event.unsigned[
"knock_room_state"
] = await self.store.get_stripped_room_state_from_event_context(
context,
self.room_prejoin_state_types,
)

if event.type == EventTypes.Redaction:
original_event = await self.store.get_event(
Expand Down

0 comments on commit deaf3d8

Please sign in to comment.