diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-10-15 17:09:04 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-10-15 17:09:04 +0100 |
commit | 1c445f88f64beabf0bd9bec3950a4a4c0d529e8a (patch) | |
tree | 12e777f2992d08645687fba8403ecf21c5c21dee /synapse/storage/pdu.py | |
parent | Merge branch 'develop' into event_signing (diff) | |
download | synapse-1c445f88f64beabf0bd9bec3950a4a4c0d529e8a.tar.xz |
persist hashes and origin signatures for PDUs
Diffstat (limited to 'synapse/storage/pdu.py')
-rw-r--r-- | synapse/storage/pdu.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/storage/pdu.py b/synapse/storage/pdu.py index d70467dcd6..9d624429b7 100644 --- a/synapse/storage/pdu.py +++ b/synapse/storage/pdu.py @@ -64,6 +64,11 @@ class PduStore(SQLBaseStore): for r in PduEdgesTable.decode_results(txn.fetchall()) ] + hashes = self._get_pdu_hashes_txn(txn, pdu_id, origin) + signatures = self._get_pdu_origin_signatures_txn( + txn, pdu_id, origin + ) + query = ( "SELECT %(fields)s FROM %(pdus)s as p " "LEFT JOIN %(state)s as s " @@ -80,7 +85,9 @@ class PduStore(SQLBaseStore): row = txn.fetchone() if row: - results.append(PduTuple(PduEntry(*row), edges)) + results.append(PduTuple( + PduEntry(*row), edges, hashes, signatures + )) return results @@ -908,7 +915,7 @@ This does not include a prev_pdus key. PduTuple = namedtuple( "PduTuple", - ("pdu_entry", "prev_pdu_list") + ("pdu_entry", "prev_pdu_list", "hashes", "signatures") ) """ This is a tuple of a `PduEntry` and a list of `PduIdTuple` that represent the `prev_pdus` key of a PDU. |