diff options
author | Erik Johnston <erik@matrix.org> | 2019-01-23 20:05:44 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-01-23 20:07:47 +0000 |
commit | 7c288c22500e2045d36a29c38d2671fad6484e30 (patch) | |
tree | 39bbd259e15dfae1daf77003f7eff4bb9e6ce5b5 /synapse/storage | |
parent | Remove unnecessary '_sign_event' (diff) | |
download | synapse-7c288c22500e2045d36a29c38d2671fad6484e30.tar.xz |
Clarify the invite flows
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/roommember.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index c7488f4259..40b13de80b 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -588,10 +588,13 @@ class RoomMemberStore(RoomMemberWorkerStore): ) # We update the local_invites table only if the event is "current", - # i.e., its something that has just happened. - # The only current event that can also be an outlier is if its an - # invite that has come in across federation. - is_new_state = not backfilled + # i.e., its something that has just happened. If the event is an + # outlier it is only current if its a "new remote event", like a + # remote invite or a rejection of a remote invite. + is_new_state = not backfilled and ( + not event.internal_metadata.is_outlier() + or event.internal_metadata.is_new_remote_event() + ) is_mine = self.hs.is_mine_id(event.state_key) if is_new_state and is_mine: if event.membership == Membership.INVITE: |