summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-17 16:50:04 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-17 16:50:04 +0100
commitc5cec1cc77029c21f0117c318c522ab320de3923 (patch)
treee7d3a36d1db4935f306f4354bed59bfc92ea2828 /synapse/federation
parentmove 'age' into 'meta' subdict so that it is clearer that it is not part of t... (diff)
downloadsynapse-c5cec1cc77029c21f0117c318c522ab320de3923.tar.xz
Rename 'meta' to 'unsigned'
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/replication.py14
-rw-r--r--synapse/federation/units.py1
2 files changed, 7 insertions, 8 deletions
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py
index c4993aa5ee..f2a5d4d5e2 100644
--- a/synapse/federation/replication.py
+++ b/synapse/federation/replication.py
@@ -295,10 +295,10 @@ class ReplicationLayer(object):
         transaction = Transaction(**transaction_data)
 
         for p in transaction.pdus:
-            if "meta" in p:
-                meta = p["meta"]
-                if "age" in meta:
-                    p["age"] = meta["age"]
+            if "unsigned" in p:
+                unsigned = p["unsigned"]
+                if "age" in unsigned:
+                    p["age"] = unsigned["age"]
             if "age" in p:
                 p["age_ts"] = int(self._clock.time_msec()) - int(p["age"])
                 del p["age"]
@@ -422,7 +422,7 @@ class ReplicationLayer(object):
         for p in pdus:
             if "age_ts" in p:
                 age = time_now - p["age_ts"]
-                p.setdefault("meta", {})["age"] = int(age)
+                p.setdefault("unsigned", {})["age"] = int(age)
                 del p["age_ts"]
         return Transaction(
             origin=self.server_name,
@@ -620,8 +620,8 @@ class _TransactionQueue(object):
                 if "pdus" in data:
                     for p in data["pdus"]:
                         if "age_ts" in p:
-                            meta = p.setdefault("meta", {})
-                            meta["age"] = now - int(p["age_ts"])
+                            unsigned = p.setdefault("unsigned", {})
+                            unsigned["age"] = now - int(p["age_ts"])
                             del p["age_ts"]
                 return data
 
diff --git a/synapse/federation/units.py b/synapse/federation/units.py
index c4a10a4123..c629e5793e 100644
--- a/synapse/federation/units.py
+++ b/synapse/federation/units.py
@@ -72,7 +72,6 @@ class Pdu(JsonEncodedObject):
         "prev_state_origin",
         "required_power_level",
         "user_id",
-        "meta"
     ]
 
     internal_keys = [