diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py index db2c050b3c..14e4b2ae69 100644 --- a/synapse/federation/federation_client.py +++ b/synapse/federation/federation_client.py @@ -39,6 +39,7 @@ from synapse.util.caches.expiringcache import ExpiringCache from synapse.util.logcontext import make_deferred_yieldable, run_in_background from synapse.util.logutils import log_function from synapse.util.retryutils import NotRetryingDestination +from synapse.federation.units import _mangle_pdu logger = logging.getLogger(__name__) @@ -712,7 +713,7 @@ class FederationClient(FederationBase): destination=destination, room_id=room_id, event_id=event_id, - content=pdu.get_pdu_json(time_now), + content=_mangle_pdu(pdu.get_pdu_json(time_now)), ) except HttpResponseException as e: if e.code == 403: diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 5d8e6c71d8..230a57a872 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -1420,6 +1420,8 @@ class FederationHandler(BaseHandler): sender, target, event.room_id, ) + FrozenEvent.from_event(event) + event.unsigned.pop("invite_room_state", None) defer.returnValue(event) @defer.inlineCallbacks