diff options
author | Erik Johnston <erik@matrix.org> | 2014-10-29 16:59:24 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-10-29 16:59:24 +0000 |
commit | e7858b6d7ef37849a3d2d5004743cdd21ec330a8 (patch) | |
tree | be917c0b61075a287f169ec5210a0b2dab563603 /synapse/federation | |
parent | Don't reference PDU when persisting event (diff) | |
download | synapse-e7858b6d7ef37849a3d2d5004743cdd21ec330a8.tar.xz |
Start filling out and using new events tables
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/pdu_codec.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/federation/pdu_codec.py b/synapse/federation/pdu_codec.py index 2cd591410b..dccbccb85b 100644 --- a/synapse/federation/pdu_codec.py +++ b/synapse/federation/pdu_codec.py @@ -48,8 +48,8 @@ class PduCodec(object): kwargs["room_id"] = pdu.context kwargs["etype"] = pdu.pdu_type kwargs["prev_events"] = [ - encode_event_id(i, o) - for i, o in pdu.prev_pdus + (encode_event_id(i, o), s) + for i, o, s in pdu.prev_pdus ] if hasattr(pdu, "prev_state_id") and hasattr(pdu, "prev_state_origin"): @@ -82,7 +82,13 @@ class PduCodec(object): d["pdu_type"] = event.type if hasattr(event, "prev_events"): - d["prev_pdus"] = [decode_event_id(e) for e in event.prev_events] + def f(e, s): + i, o = decode_event_id(e, self.server_name) + return i, o, s + d["prev_pdus"] = [ + f(e, s) + for e, s in event.prev_events + ] if hasattr(event, "prev_state"): d["prev_state_id"], d["prev_state_origin"] = ( |