mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 15:08:49 +03:00
SYN-103: Ignore the 'origin' key in received EDUs. Instead take the origin from the transaction itself
This commit is contained in:
parent
f74e850b5c
commit
9aed791fc3
5 changed files with 10 additions and 3 deletions
|
@ -319,7 +319,7 @@ class ReplicationLayer(object):
|
||||||
|
|
||||||
if hasattr(transaction, "edus"):
|
if hasattr(transaction, "edus"):
|
||||||
for edu in [Edu(**x) for x in 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)
|
results = yield defer.DeferredList(dl)
|
||||||
|
|
||||||
|
|
|
@ -156,11 +156,15 @@ class Edu(JsonEncodedObject):
|
||||||
]
|
]
|
||||||
|
|
||||||
required_keys = [
|
required_keys = [
|
||||||
"origin",
|
|
||||||
"destination",
|
|
||||||
"edu_type",
|
"edu_type",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# TODO: SYN-103: Remove "origin" and "destination" keys.
|
||||||
|
# internal_keys = [
|
||||||
|
# "origin",
|
||||||
|
# "destination",
|
||||||
|
# ]
|
||||||
|
|
||||||
|
|
||||||
class Transaction(JsonEncodedObject):
|
class Transaction(JsonEncodedObject):
|
||||||
""" A transaction is a list of Pdus and Edus to be sent to a remote home
|
""" A transaction is a list of Pdus and Edus to be sent to a remote home
|
||||||
|
|
|
@ -211,6 +211,7 @@ class FederationTestCase(unittest.TestCase):
|
||||||
"pdus": [],
|
"pdus": [],
|
||||||
"edus": [
|
"edus": [
|
||||||
{
|
{
|
||||||
|
# TODO: SYN-103: Remove "origin" and "destination"
|
||||||
"origin": "test",
|
"origin": "test",
|
||||||
"destination": "remote",
|
"destination": "remote",
|
||||||
"edu_type": "m.test",
|
"edu_type": "m.test",
|
||||||
|
|
|
@ -43,6 +43,7 @@ def _expect_edu(destination, edu_type, content, origin="test"):
|
||||||
"pdus": [],
|
"pdus": [],
|
||||||
"edus": [
|
"edus": [
|
||||||
{
|
{
|
||||||
|
# TODO: SYN-103: Remove "origin" and "destination" keys.
|
||||||
"origin": origin,
|
"origin": origin,
|
||||||
"destination": destination,
|
"destination": destination,
|
||||||
"edu_type": edu_type,
|
"edu_type": edu_type,
|
||||||
|
|
|
@ -33,6 +33,7 @@ def _expect_edu(destination, edu_type, content, origin="test"):
|
||||||
"pdus": [],
|
"pdus": [],
|
||||||
"edus": [
|
"edus": [
|
||||||
{
|
{
|
||||||
|
# TODO: SYN-103: Remove "origin" and "destination" keys.
|
||||||
"origin": origin,
|
"origin": origin,
|
||||||
"destination": destination,
|
"destination": destination,
|
||||||
"edu_type": edu_type,
|
"edu_type": edu_type,
|
||||||
|
|
Loading…
Reference in a new issue