summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-14 21:25:02 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-14 21:25:02 +0000
commitcb4b6c844a0c9e2d4a96165958ff5680ed82e160 (patch)
tree541226f5258a0e4b2e3ebdd1a4759bd9404f431d /synapse/api
parentFix PDU and event signatures (diff)
downloadsynapse-cb4b6c844a0c9e2d4a96165958ff5680ed82e160.tar.xz
Merge PDUs and Events into one object
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/events/__init__.py6
-rw-r--r--synapse/api/events/utils.py2
2 files changed, 8 insertions, 0 deletions
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py
index 1d8bed2906..63c0bd7ae7 100644
--- a/synapse/api/events/__init__.py
+++ b/synapse/api/events/__init__.py
@@ -117,6 +117,12 @@ class SynapseEvent(JsonEncodedObject):
         """
         raise NotImplementedError("get_content_template not implemented.")
 
+    def get_pdu_json(self):
+        pdu_json = self.get_full_dict()
+        pdu_json.pop("destination", None)
+        pdu_json.pop("outlier", None)
+        return pdu_json
+
 
 class SynapseStateEvent(SynapseEvent):
 
diff --git a/synapse/api/events/utils.py b/synapse/api/events/utils.py
index 802648f8f7..d6019d56eb 100644
--- a/synapse/api/events/utils.py
+++ b/synapse/api/events/utils.py
@@ -42,6 +42,8 @@ def prune_event(event):
         "prev_events",
         "prev_state",
         "auth_events",
+        "origin",
+        "origin_server_ts",
     ]
 
     new_content = {}