Don't apply new room join hack if depth > 5
This commit is contained in:
parent
5ae4a84211
commit
7223129916
|
@ -924,9 +924,12 @@ class FederationHandler(BaseHandler):
|
||||||
# This is a hack to fix some old rooms where the initial join event
|
# This is a hack to fix some old rooms where the initial join event
|
||||||
# didn't reference the create event in its auth events.
|
# didn't reference the create event in its auth events.
|
||||||
if event.type == EventTypes.Member and not event.auth_events:
|
if event.type == EventTypes.Member and not event.auth_events:
|
||||||
if len(event.prev_events) == 1:
|
if len(event.prev_events) == 1 and event.depth < 5:
|
||||||
c = yield self.store.get_event(event.prev_events[0][0])
|
c = yield self.store.get_event(
|
||||||
if c.type == EventTypes.Create:
|
event.prev_events[0][0],
|
||||||
|
allow_none=True,
|
||||||
|
)
|
||||||
|
if c and c.type == EventTypes.Create:
|
||||||
auth_events[(c.type, c.state_key)] = c
|
auth_events[(c.type, c.state_key)] = c
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue