mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 20:54:50 -04:00
Merge branch 'replication_split' of github.com:matrix-org/synapse into rejections
Conflicts: synapse/storage/schema/delta/v12.sql
This commit is contained in:
commit
c515d37797
4 changed files with 7 additions and 10 deletions
|
@ -37,13 +37,15 @@ def _get_state_key_from_event(event):
|
|||
KeyStateTuple = namedtuple("KeyStateTuple", ("context", "type", "state_key"))
|
||||
|
||||
|
||||
AuthEventTypes = (EventTypes.Create, EventTypes.Member, EventTypes.PowerLevels,)
|
||||
|
||||
|
||||
class StateHandler(object):
|
||||
""" Responsible for doing state conflict resolution.
|
||||
"""
|
||||
|
||||
def __init__(self, hs):
|
||||
self.store = hs.get_datastore()
|
||||
# self.auth = hs.get_auth()
|
||||
self.hs = hs
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
@ -231,7 +233,7 @@ class StateHandler(object):
|
|||
|
||||
auth_events = {
|
||||
k: e for k, e in unconflicted_state.items()
|
||||
if k[0] in (EventTypes.Create, EventTypes.Member, EventTypes.PowerLevels,)
|
||||
if k[0] in AuthEventTypes
|
||||
}
|
||||
|
||||
try:
|
||||
|
@ -317,4 +319,4 @@ class StateHandler(object):
|
|||
def key_func(e):
|
||||
return -int(e.depth), hashlib.sha1(e.event_id).hexdigest()
|
||||
|
||||
return sorted(events, key=key_func)
|
||||
return sorted(events, key=key_func)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue