Don't reference PDU when persisting event

This commit is contained in:
Erik Johnston 2014-10-28 17:15:32 +00:00
parent 2d1dfb3b34
commit a10c2ec88d
2 changed files with 5 additions and 4 deletions

View File

@ -322,9 +322,10 @@ class DataStore(RoomMemberStore, RoomStore,
txn, event.event_id, prev_event_id, alg, hash_bytes txn, event.event_id, prev_event_id, alg, hash_bytes
) )
# TODO
(ref_alg, ref_hash_bytes) = compute_pdu_event_reference_hash(pdu) (ref_alg, ref_hash_bytes) = compute_pdu_event_reference_hash(pdu)
self._store_pdu_reference_hash_txn( self._store_event_reference_hash_txn(
txn, pdu.pdu_id, pdu.origin, ref_alg, ref_hash_bytes txn, event.event_id, ref_alg, ref_hash_bytes
) )
self._update_min_depth_for_room_txn(txn, event.room_id, event.depth) self._update_min_depth_for_room_txn(txn, event.room_id, event.depth)

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
from ._base import SQLBaseStore from ._base import SQLBaseStore
from twisted.internet import defer from syutil.base64util import encode_base64
import logging import logging
@ -36,7 +36,7 @@ class EventFederationStore(SQLBaseStore):
results = [] results = []
for pdu_id, origin, depth in txn.fetchall(): for pdu_id, origin, depth in txn.fetchall():
hashes = self._get_pdu_reference_hashes_txn(txn, pdu_id, origin) hashes = self._get_prev_event_hashes_txn(txn, pdu_id, origin)
sha256_bytes = hashes["sha256"] sha256_bytes = hashes["sha256"]
prev_hashes = {"sha256": encode_base64(sha256_bytes)} prev_hashes = {"sha256": encode_base64(sha256_bytes)}
results.append((pdu_id, origin, prev_hashes, depth)) results.append((pdu_id, origin, prev_hashes, depth))