mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Handle None state group correctly
This commit is contained in:
parent
23da638360
commit
619e8ecd0c
@ -364,11 +364,11 @@ class StateHandler(object):
|
|||||||
|
|
||||||
prev_group = None
|
prev_group = None
|
||||||
delta_ids = None
|
delta_ids = None
|
||||||
for old_group, old_ids in state_groups_ids.items():
|
for old_group, old_ids in state_groups_ids.iteritems():
|
||||||
if not set(new_state.iterkeys()) - set(old_ids.iterkeys()):
|
if not set(new_state) - set(old_ids):
|
||||||
n_delta_ids = {
|
n_delta_ids = {
|
||||||
k: v
|
k: v
|
||||||
for k, v in new_state.items()
|
for k, v in new_state.iteritems()
|
||||||
if old_ids.get(k) != v
|
if old_ids.get(k) != v
|
||||||
}
|
}
|
||||||
if not delta_ids or len(n_delta_ids) < len(delta_ids):
|
if not delta_ids or len(n_delta_ids) < len(delta_ids):
|
||||||
|
@ -692,7 +692,10 @@ class _JoinedHostsCache(object):
|
|||||||
host = intern_string(get_domain_from_id(user_id))
|
host = intern_string(get_domain_from_id(user_id))
|
||||||
self.hosts_to_joined_users.setdefault(host, set()).add(user_id)
|
self.hosts_to_joined_users.setdefault(host, set()).add(user_id)
|
||||||
|
|
||||||
|
if state_entry.state_group:
|
||||||
self.state_group = state_entry.state_group
|
self.state_group = state_entry.state_group
|
||||||
|
else:
|
||||||
|
self.state_group = object()
|
||||||
self._len = sum(len(v) for v in self.hosts_to_joined_users.itervalues())
|
self._len = sum(len(v) for v in self.hosts_to_joined_users.itervalues())
|
||||||
defer.returnValue(frozenset(self.hosts_to_joined_users))
|
defer.returnValue(frozenset(self.hosts_to_joined_users))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user