mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:26:02 -04:00
Use state groups to get current state. Make join dance actually work.
This commit is contained in:
parent
f71627567b
commit
5ffe5ab43f
10 changed files with 231 additions and 72 deletions
|
@ -403,11 +403,18 @@ class ReplicationLayer(object):
|
|||
defer.returnValue(
|
||||
(404, "No handler for Query type '%s'" % (query_type, ))
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_make_join_request(self, context, user_id):
|
||||
pdu = yield self.handler.on_make_join_request(context, user_id)
|
||||
defer.returnValue(pdu.get_dict())
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_invite_request(self, origin, content):
|
||||
pdu = Pdu(**content)
|
||||
ret_pdu = yield self.handler.on_send_join_request(origin, pdu)
|
||||
defer.returnValue((200, ret_pdu.get_dict()))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_send_join_request(self, origin, content):
|
||||
pdu = Pdu(**content)
|
||||
|
@ -426,8 +433,9 @@ class ReplicationLayer(object):
|
|||
|
||||
defer.returnValue(Pdu(**pdu_dict))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def send_join(self, destination, pdu):
|
||||
return self.transport_layer.send_join(
|
||||
_, content = yield self.transport_layer.send_join(
|
||||
destination,
|
||||
pdu.context,
|
||||
pdu.pdu_id,
|
||||
|
@ -435,6 +443,13 @@ class ReplicationLayer(object):
|
|||
pdu.get_dict(),
|
||||
)
|
||||
|
||||
logger.debug("Got content: %s", content)
|
||||
pdus = [Pdu(outlier=True, **p) for p in content.get("pdus", [])]
|
||||
for pdu in pdus:
|
||||
yield self._handle_new_pdu(destination, pdu)
|
||||
|
||||
defer.returnValue(pdus)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
@log_function
|
||||
def _get_persisted_pdu(self, pdu_id, pdu_origin):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue