Skip to content

Commit

Permalink
Add a workaround for bug where some initial join events don't referen…
Browse files Browse the repository at this point in the history
…ce creation events in their auth_events
  • Loading branch information
erikjohnston committed Nov 26, 2014
1 parent 6c485c2 commit 858e87a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from synapse.api.errors import (
AuthError, FederationError, SynapseError, StoreError,
)
from synapse.api.events.room import RoomMemberEvent
from synapse.api.events.room import RoomMemberEvent, RoomCreateEvent
from synapse.api.constants import Membership
from synapse.util.logutils import log_function
from synapse.util.async import run_on_reactor
Expand Down Expand Up @@ -618,6 +618,12 @@ def _handle_new_event(self, event, state=None, backfilled=False,

auth_events[(e.type, e.state_key)] = e

if event.type == RoomMemberEvent.TYPE and not event.auth_events:
if len(event.prev_events) == 1:
c = yield self.store.get_event(event.prev_events[0][0])
if c.type == RoomCreateEvent.TYPE:
auth_events[(c.type, c.state_key)] = c

self.auth.check(event, auth_events=auth_events)

yield self.store.persist_event(
Expand Down

0 comments on commit 858e87a

Please sign in to comment.