Use state groups to get current state. Make join dance actually work.

This commit is contained in:
Erik Johnston 2014-10-17 18:56:42 +01:00
parent f71627567b
commit 5ffe5ab43f
10 changed files with 231 additions and 72 deletions

View file

@ -277,6 +277,12 @@ class PduStore(SQLBaseStore):
(context, depth)
)
def get_latest_pdus_in_context(self, context):
return self.runInteraction(
self._get_latest_pdus_in_context,
context
)
def _get_latest_pdus_in_context(self, txn, context):
"""Get's a list of the most current pdus for a given context. This is
used when we are sending a Pdu and need to fill out the `prev_pdus`

View file

@ -63,6 +63,9 @@ class StateStore(SQLBaseStore):
)
def _store_state_groups_txn(self, txn, event):
if not event.state_events:
return
state_group = event.state_group
if not state_group:
state_group = self._simple_insert_txn(