summary refs log tree commit diff
path: root/synapse/federation/pdu_codec.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-29 16:59:24 +0000
committerErik Johnston <erik@matrix.org>2014-10-29 16:59:24 +0000
commite7858b6d7ef37849a3d2d5004743cdd21ec330a8 (patch)
treebe917c0b61075a287f169ec5210a0b2dab563603 /synapse/federation/pdu_codec.py
parentDon't reference PDU when persisting event (diff)
downloadsynapse-e7858b6d7ef37849a3d2d5004743cdd21ec330a8.tar.xz
Start filling out and using new events tables
Diffstat (limited to 'synapse/federation/pdu_codec.py')
-rw-r--r--synapse/federation/pdu_codec.py12
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"] = (