SYN-103: Ignore the 'origin' key in received EDUs. Instead take the origin from the transaction itself

pull/9/head
Mark Haines 2014-10-14 16:44:27 +01:00
parent f74e850b5c
commit 9aed791fc3
5 changed files with 10 additions and 3 deletions

View File

@ -319,7 +319,7 @@ class ReplicationLayer(object):
if hasattr(transaction, "edus"):
for edu in [Edu(**x) for x in transaction.edus]:
self.received_edu(edu.origin, edu.edu_type, edu.content)
self.received_edu(transaction.origin, edu.edu_type, edu.content)
results = yield defer.DeferredList(dl)

View File

@ -156,11 +156,15 @@ class Edu(JsonEncodedObject):
]
required_keys = [
"origin",
"destination",
"edu_type",
]
# TODO: SYN-103: Remove "origin" and "destination" keys.
# internal_keys = [
# "origin",
# "destination",
# ]
class Transaction(JsonEncodedObject):
""" A transaction is a list of Pdus and Edus to be sent to a remote home

View File

@ -211,6 +211,7 @@ class FederationTestCase(unittest.TestCase):
"pdus": [],
"edus": [
{
# TODO: SYN-103: Remove "origin" and "destination"
"origin": "test",
"destination": "remote",
"edu_type": "m.test",

View File

@ -43,6 +43,7 @@ def _expect_edu(destination, edu_type, content, origin="test"):
"pdus": [],
"edus": [
{
# TODO: SYN-103: Remove "origin" and "destination" keys.
"origin": origin,
"destination": destination,
"edu_type": edu_type,

View File

@ -33,6 +33,7 @@ def _expect_edu(destination, edu_type, content, origin="test"):
"pdus": [],
"edus": [
{
# TODO: SYN-103: Remove "origin" and "destination" keys.
"origin": origin,
"destination": destination,
"edu_type": edu_type,