forked from MirrorHub/synapse
Fixup comment (and indent)
This commit is contained in:
parent
f33c596533
commit
ed0dd68731
1 changed files with 20 additions and 16 deletions
|
@ -565,6 +565,7 @@ class EventsStore(EventsWorkerStore):
|
||||||
# map from state_group to ((type, key) -> event_id) state map
|
# map from state_group to ((type, key) -> event_id) state map
|
||||||
state_groups_map = {}
|
state_groups_map = {}
|
||||||
|
|
||||||
|
# Map from (prev state group, new state group) -> delta state dict
|
||||||
state_group_deltas = {}
|
state_group_deltas = {}
|
||||||
|
|
||||||
for ev, ctx in events_context:
|
for ev, ctx in events_context:
|
||||||
|
@ -631,10 +632,11 @@ class EventsStore(EventsWorkerStore):
|
||||||
if old_state_groups == new_state_groups:
|
if old_state_groups == new_state_groups:
|
||||||
defer.returnValue((None, None))
|
defer.returnValue((None, None))
|
||||||
|
|
||||||
if len(new_state_groups) == 1:
|
if len(new_state_groups) == 1 and len(old_state_groups) == 1:
|
||||||
# If there is only one state group, then we know what the current
|
# If we're going from one state group to another, lets check if
|
||||||
# state is.
|
# we have a delta for that transition. If we do then we can just
|
||||||
if len(old_state_groups) == 1:
|
# return that.
|
||||||
|
|
||||||
new_state_group = next(iter(new_state_groups))
|
new_state_group = next(iter(new_state_groups))
|
||||||
old_state_group = next(iter(old_state_groups))
|
old_state_group = next(iter(old_state_groups))
|
||||||
|
|
||||||
|
@ -657,6 +659,8 @@ class EventsStore(EventsWorkerStore):
|
||||||
state_groups_map.update(group_to_state)
|
state_groups_map.update(group_to_state)
|
||||||
|
|
||||||
if len(new_state_groups) == 1:
|
if len(new_state_groups) == 1:
|
||||||
|
# If there is only one state group, then we know what the current
|
||||||
|
# state is.
|
||||||
defer.returnValue((state_groups_map[new_state_groups.pop()], None))
|
defer.returnValue((state_groups_map[new_state_groups.pop()], None))
|
||||||
|
|
||||||
# Ok, we need to defer to the state handler to resolve our state sets.
|
# Ok, we need to defer to the state handler to resolve our state sets.
|
||||||
|
|
Loading…
Reference in a new issue